| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I've a question about the compiler optimization "loop unswitching" and its compiler heuristics. In case of a single loop independent if/if-else statement within the loop, there's not much choice for the conditional to be moved outside of the loop. But what are reasonable compiler decisions when a loop holds multiple loop independent conditions? It might be not a good idea to unswitch the loop separately for each condition since this would result in multiple duplicates of the loop body possibly increasing the code size too heavily. Thus, a compiler will very likely evaluate the conditions with their then/else parts and begin with the most promising condition. Any ideas how such an evaluation might work? Does it even make sense to combine several conditions and move this new mixed condition outside the loop? Regards, Stephan |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.