4 ms·
No, it's correct. It's saying "if they are always computed, we move them up". IE if (a) foo = a + b else b foo = a + b -> foo = a+b if (a)
by DannyBee 10y ago
No, it's correct.
It's saying "if they are always computed, we move them up".
IE
if (a)
foo = a + b
else b
foo = a + b
->
foo = a+b
if (a)
else (b)
- mindleyhilner 10y agoHow do you move up towards exit?
- evilpie 10y agoI think you have to read it like "executed on >all paths to the function exit< as early as possible". As in, if you have an expression that is always executed regardless which path you take before returning. It's useful to move that expression upwards instead of having copies on the different paths to the function exit.
- sanjoy_das 10y agoMy guess is that they meant "up" in the sense of "up in post dominator tree".
- fenollp 10y agoPossible side effects correction: -> if (a) else (b) foo = a+b