diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-08-19 15:30:45 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-08-25 11:33:32 -0700 |
commit | d9a0d692ffc6951c5670f54c3f4f17ec64a58600 (patch) | |
tree | 5a1a6cf0d6fa5153c8f688406efe8f9b29a08715 /gcc/tree-nested.cc | |
parent | 6df8dcec7196e42ca2eed69e1ae455bae8d0fe93 (diff) | |
download | gcc-d9a0d692ffc6951c5670f54c3f4f17ec64a58600.zip gcc-d9a0d692ffc6951c5670f54c3f4f17ec64a58600.tar.gz gcc-d9a0d692ffc6951c5670f54c3f4f17ec64a58600.tar.bz2 |
MATCH: Move `a ? one_zero : one_zero` matching after min/max matching
In PR 106677, I noticed that on the trunk we were producing:
```
_25 = SR.116_117 == 0;
_27 = (unsigned char) _25;
_32 = _27 | SR.116_117;
```
From `SR.115_117 != 0 ? SR.115_117 : 1`
Rather than:
```
_119 = MAX_EXPR <1, SR.115_117>;
```
Or (rather)
```
_119 = SR.115_117 | 1;
```
Due to the order of the patterns.
Committed as approved with the new comment and testcase.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* match.pd (`a ? one_zero : one_zero`): Move
below detection of minmax.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/phi-opt-34.c: New test.
Diffstat (limited to 'gcc/tree-nested.cc')
0 files changed, 0 insertions, 0 deletions