diff options
author | Andrew Pinski <pinskia@gmail.com> | 2023-10-15 15:18:42 -0700 |
---|---|---|
committer | Andrew Pinski <pinskia@gmail.com> | 2023-10-16 09:59:56 -0700 |
commit | 29a4453c7b8a86d242dab89b9e4d222749fd911e (patch) | |
tree | cd9af0d09b4ab05e184e8332b56bbd441db52319 /gcc/tree-pass.h | |
parent | 7550130c8620085c4efdde3575190588795f9b61 (diff) | |
download | gcc-29a4453c7b8a86d242dab89b9e4d222749fd911e.zip gcc-29a4453c7b8a86d242dab89b9e4d222749fd911e.tar.gz gcc-29a4453c7b8a86d242dab89b9e4d222749fd911e.tar.bz2 |
[PR31531] MATCH: Improve ~a < ~b and ~a < CST, allow a nop cast inbetween ~ and a/b
Currently we able to simplify `~a CMP ~b` to `b CMP a` but we should allow a nop
conversion in between the `~` and the `a` which can show up. A similarly thing should
be done for `~a CMP CST`.
I had originally submitted the `~a CMP CST` case as
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585088.html;
I noticed we should do the same thing for the `~a CMP ~b` case and combined
it with that one here.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR tree-optimization/31531
gcc/ChangeLog:
* match.pd (~X op ~Y): Allow for an optional nop convert.
(~X op C): Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr31531-1.c: New test.
* gcc.dg/tree-ssa/pr31531-2.c: New test.
Diffstat (limited to 'gcc/tree-pass.h')
0 files changed, 0 insertions, 0 deletions