aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
authorjlaw <jeffreyalaw@gmail.com>2024-03-10 11:58:00 -0600
committerjlaw <jeffreyalaw@gmail.com>2024-03-10 12:03:52 -0600
commit8fe27ed193d60f6cd8b34761858a720c95eabbdb (patch)
tree40695c03bebeee3a971d5c259ec48960934d967b /gcc/tree-vect-loop.cc
parent993c6de642ffeb2867edbe80ff2a72c0a2eb604e (diff)
downloadgcc-8fe27ed193d60f6cd8b34761858a720c95eabbdb.zip
gcc-8fe27ed193d60f6cd8b34761858a720c95eabbdb.tar.gz
gcc-8fe27ed193d60f6cd8b34761858a720c95eabbdb.tar.bz2
[committed] [PR tree-optimization/110199] Simplify MIN/MAX more often
So as I mentioned in the BZ, the case of t = MIN_EXPR (A, B) where we know something about the relationship between A and B can be trivially handled by some existing code in DOM. That existing code would simplify when A == B. But by testing GE and LE instead of EQ we can cover more cases with minimal effort. When applicable the MIN/MAX turns into a simple copy. I made one other change. We have other binary operations that we simplify when we know something about the relationship between the operands. That code was not canonicalizing the order of operands when building the expression to lookup in the hash tables to discover that relationship. Since those paths are only testing for equality, we can trivially reverse them and not have to worry about changing codes or anything like that. So extremely safe and avoids having to come back and fix that code to match the MIN_EXPR/MAX_EXPR case later. Bootstrapped on x86 and also tested on the crosses. I briefly thought there was an sh regression, but that was actually the recent fwprop changes twiddling code generation for one test. PR tree-optimization/110199 gcc/ * tree-ssa-scopedtables.cc (avail_exprs_stack::simplify_binary_operation): Generalize handling of MIN_EXPR/MAX_EXPR to allow additional simplifications. Canonicalize comparison operands for other cases. gcc/testsuite * gcc.dg/tree-ssa/minmax-27.c: New test. * gcc.dg/tree-ssa/minmax-28.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions