diff options
author | Andrew Pinski <pinskia@gmail.com> | 2023-10-24 23:13:18 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gmail.com> | 2023-10-26 18:58:40 +0000 |
commit | 662655e22dddf5392d9aa67fce45beee980e5454 (patch) | |
tree | 4e7c52a3141a8644d9ee3bd0525a83e7bbdc5894 /gcc/expr.cc | |
parent | abd78dc61076120649ccc1ca0b1d74d0b0a22f81 (diff) | |
download | gcc-662655e22dddf5392d9aa67fce45beee980e5454.zip gcc-662655e22dddf5392d9aa67fce45beee980e5454.tar.gz gcc-662655e22dddf5392d9aa67fce45beee980e5454.tar.bz2 |
match: Simplify `a != C1 ? abs(a) : C2` when C2 == abs(C1) [PR111957]
This adds a match pattern for `a != C1 ? abs(a) : C2` which gets simplified
to `abs(a)`. if C1 was originally *_MIN then change it over to use absu instead
of abs.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR tree-optimization/111957
gcc/ChangeLog:
* match.pd (`a != C1 ? abs(a) : C2`): New pattern.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/phi-opt-40.c: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions