[Bug middle-end/70159] missed CSE optimization

spop at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 10 06:05:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70159

--- Comment #7 from Sebastian Pop <spop at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #6)
> Note this is both a hoisting and a sinking issue.
> Hoisting should happen before sinking.
> LLVM looks like it only implements sinking.

You are right: LLVM does sinking very early as part of instcombine: it
transforms the phi nodes after the if into selects over the operands and sinks
the sub and mul after the select.  By the time other redundancy elimination
passes are executed the shape of the code is more difficult to optimize.


More information about the Gcc-bugs mailing list