This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Hoist reciprocal invariant out of loop
>>>>> Zdenek Dvorak writes:
Zdenek> Inside invariant analysis, you should use outermost_invariant_loop.
outermost_invariant_loop() documentation states that it returns
the outermost loop to which the expression could be moved, "the outermost
loop enclosing LOOP." What if there is no enclosing loop?
When I tried using outermost_invariant_loop(), it seemed to be
returning the current loop if there was no superloop. In an outermost
loop, I could not distinguish between a stmt that was invariant (and could
be hoisted into the BB containing the loop) and one that was not invariant
to the loop.
David