diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-12-31 10:19:06 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-12-31 10:19:06 +0100 |
commit | d96b8556e569a1ccce36ef990e167031d07a661a (patch) | |
tree | d05139a38775fcc9e673e0d1b808dbc60da0b897 /gcc/print-rtl-function.c | |
parent | 1af3f4a2893203492cce59b72eff3f7bb4aef04c (diff) | |
download | gcc-d96b8556e569a1ccce36ef990e167031d07a661a.zip gcc-d96b8556e569a1ccce36ef990e167031d07a661a.tar.gz gcc-d96b8556e569a1ccce36ef990e167031d07a661a.tar.bz2 |
reassoc: Optimize x > 0x1fff || y > 0x1fff into (x | y) > 0x1fff [PR56719]
The following patch adds an optimization mentioned in PR56719 #c8.
We already have the x != 0 && y != 0 && z != 0 into (x | y | z) != 0
and x != -1 && y != -1 && y != -1 into (x & y & z) != -1
optimizations, this patch just extends that to
x < C && y < C && z < C for power of two constants C into
(x | y | z) < C (for unsigned comparisons).
I didn't want to create too many buckets (there can be TYPE_PRECISION such
constants), so the patch instead just uses one buckets for all such
constants and loops over that bucket up to TYPE_PRECISION times.
2020-12-31 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56719
* tree-ssa-reassoc.c (optimize_range_tests_cmp_bitwise): Also optimize
x < C && y < C && z < C when C is a power of two constant into
(x | y | z) < C.
* gcc.dg/tree-ssa/pr56719.c: New test.
Diffstat (limited to 'gcc/print-rtl-function.c')
0 files changed, 0 insertions, 0 deletions