On 9/9/26 6:07 PM, Andrea Pinski wrote:
So when I wrote this code I limited the middle store to only
be a SSA name. This is too limited and we reject constants which the full
cselim can handle just fine. This extends the check to support gimple
min invariants too.
Instead of the check for ssa name, reject clobbers instead.
Changes since v1:
* v2: Change the checks to reject clobbers instead of checking
for min invariant/ssa names.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/127052
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_store_replacement_limited): Reject clobbers
for the middle bb store. And Remove the check on ssa name for the rhs
of the middle bb store.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/cselim-6.c: New test.
* gcc.dg/tree-ssa/cselim-7.c: New test.
Signed-off-by: Andrea Pinski <[email protected]>
OK
jeff