aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gmail.com>2023-10-26 15:07:53 -0700
committerAndrew Pinski <pinskia@gmail.com>2023-10-30 19:15:25 -0700
commit598fdb5290dcf76ef23e993409e22f1512ff835a (patch)
treee5770c37bbcfcfa4dccc0b7c20d0f79ae336f903 /gcc/d/expr.cc
parenta5c157b95a4c202ec5b8600f80e7e0c88722e8ad (diff)
downloadgcc-598fdb5290dcf76ef23e993409e22f1512ff835a.zip
gcc-598fdb5290dcf76ef23e993409e22f1512ff835a.tar.gz
gcc-598fdb5290dcf76ef23e993409e22f1512ff835a.tar.bz2
MATCH: first of the value replacement moving from phiopt
This moves a few simple patterns that are done in value replacement in phiopt over to match.pd. Just the simple ones which might show up in other code. This allows some optimizations to happen even without depending on sinking from happening and in some cases where phiopt is not invoked (cond-1.c is an example there). Changes since v1: * v2: Add an extra testcase to showcase improvements at -O1. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * match.pd: (`a == 0 ? b : b + a`, `a == 0 ? b : b - a`): New patterns. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/cond-1.c: New test. * gcc.dg/tree-ssa/phi-opt-value-1.c: New test. * gcc.dg/tree-ssa/phi-opt-value-1a.c: New test. * gcc.dg/tree-ssa/phi-opt-value-2.c: New test.
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions