diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-05-07 11:39:03 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-05-30 08:43:22 -0700 |
commit | 17cca3c43e2f496dcef0ba79e04979b49439e0c3 (patch) | |
tree | 0cb6dc27ca7bcce8b82c7c79bdb167c65aeae6df /gcc/tree-vectorizer.h | |
parent | b49bcb86851557d1a32fce1b867be786cecd6f94 (diff) | |
download | gcc-17cca3c43e2f496dcef0ba79e04979b49439e0c3.zip gcc-17cca3c43e2f496dcef0ba79e04979b49439e0c3.tar.gz gcc-17cca3c43e2f496dcef0ba79e04979b49439e0c3.tar.bz2 |
MATCH: Move `a <= CST1 ? MAX<a, CST2> : a` optimization to match
This moves the `a <= CST1 ? MAX<a, CST2> : a` optimization
from phiopt to match. It just adds a new pattern to match.pd.
There is one more change needed before being able to remove
minmax_replacement from phiopt.
A few notes on the testsuite changes:
* phi-opt-5.c is now able to optimize at phiopt1 so remove
the xfail.
* pr66726-4.c can be optimized during fold before phiopt1
so need to change the scanning.
* pr66726-5.c needs two phiopt passes currently to optimize
to the right thing, it needed 2 phiopt passes before, the cast
from int to unsigned char is the reason.
* pr66726-6.c is what the original pr66726-4.c was testing
before the fold was able to optimize it.
OK? Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* match.pd (`(a CMP CST1) ? max<a,CST2> : a`): New
pattern.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/phi-opt-5.c: Remove last xfail.
* gcc.dg/tree-ssa/pr66726-4.c: Change how scanning
works.
* gcc.dg/tree-ssa/pr66726-5.c: New test.
* gcc.dg/tree-ssa/pr66726-6.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions