https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115922
Siarhei Volkau <lis8215 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lis8215 at gmail dot com
--- Comment #3 from Siarhei Volkau <lis8215 at gmail dot com> ---
Roger, think of applying this technique to a loop - loading a constant will be
moved out of the loop and only AND instruction remains inside the loop, which
is more beneficial.
So the ori-xori approach applicable in the following conditions:
- take in account INS instruction and give it precedence
- if optimizing for speed all replacing instructions must be located in one
basic block, or at least their basic blocks belong to the same loop.
- if optimizing for size, it seems profitable always but I'm not 100% sure.
Of course peephole misses a lot of opportunities, especially after scheduling,
but it met the conditions above.