LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Loop invariant code motion" Did you know this and why didn't you tell me?

Solved!
Go to solution

I'll provide the answer if nobody replies but I'll let y'all discover this yourself.

 

Have fun,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 1 of 14
(5,202 Views)

Hint:

 

"Loop invariant code motion" invalidates suggestion we often suggest to people trying to optimize the perfomance of their loops.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 14
(5,187 Views)
Solution
Accepted by topic author Ben

Hi Ben,

 

thanks for having Wikipedia Smiley Wink

 

And: No, I wasn't aware of something like this in LabVIEW... And I always move constant code outside of loops...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 14
(5,180 Views)

And we have a winner for this afternoon's game!

 

For those that do not have access to the Wiki...

 

If the LV compiler "sees" you have code in a loop that produce the same answer for every iteration it CAN move that code to execute before the loop.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 14
(5,165 Views)

If the LV compiler "sees" you have code in a loop that produces the same answer for every iteration it SHOULD throw up a dialog that says "IDIOT!"

Richard






Message 5 of 14
(5,158 Views)

Ben wrote:

 

If the LV compiler "sees" you have code in a loop that produce the same answer for every iteration it CAN move that code to execute before the loop.

 

Ben

 

 


I assume this only works with debugging off in a manner similar to the removeal of structures with no outputs.  can you confirm?

 

Also a link to your source would be nice-  I'd like to know a bit more about this compiler feature.


"Should be" isn't "Is" -Jay
Message 6 of 14
(5,149 Views)

Ben wrote: 

 

If the LV compiler "sees" you have code in a loop that produce the same answer for every iteration it CAN move that code to execute before the loop.


 


Can, or does?

--
Tim Elsey
Certified LabVIEW Architect
Message 7 of 14
(5,125 Views)

elset191 wrote:

Ben wrote: 

 

If the LV compiler "sees" you have code in a loop that produce the same answer for every iteration it CAN move that code to execute before the loop.


 


Can, or does?


Just what I was about to ask.

0 Kudos
Message 8 of 14
(5,119 Views)

elset191 wrote:

Ben wrote: 

 

If the LV compiler "sees" you have code in a loop that produce the same answer for every iteration it CAN move that code to execute before the loop.


 


Can, or does?


 

I softened the first post but after a re-read it DOES.

 

The only reference I have is "LabVIEW Performance 2009 Course Manual" Part number 325501A-01 April 2010 Edition, Page 1-32."

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 14
(5,116 Views)

Ben wrote:


 

The only reference I have is "LabVIEW Performance 2009 Course Manual" Part number 325501A-01 April 2010 Edition, sample here

Page 1-32."  is not encluded in the sample

 

 

Ben


Any other neat features hidden in the manual- or do I need to by the class


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 14
(5,076 Views)