diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-11-06 20:38:42 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-11-08 16:10:10 +0100 |
commit | 215355d302d8602c7eeefb9c927a3dbb221714c8 (patch) | |
tree | 6e26101f73122dba6f403975dbe65e5db6533fe1 /gcc/gimple-low.cc | |
parent | cb0a2b1f28cf0c231bf38fcd02c40689739df7bb (diff) | |
download | gcc-215355d302d8602c7eeefb9c927a3dbb221714c8.zip gcc-215355d302d8602c7eeefb9c927a3dbb221714c8.tar.gz gcc-215355d302d8602c7eeefb9c927a3dbb221714c8.tar.bz2 |
CCP: handle division by a power of 2 as a right shift.
We have some code in range-ops that sets better maybe nonzero bits for
TRUNC_DIV_EXPR by a power of 2 than CCP does, by just shifting the
mask. I'd like to offload this functionality into the CCP mask
tracking code, which already does the right thing for right shifts.
The testcase for this change is gcc.dg/tree-ssa/vrp123.c and
gcc.dg/tree-ssa/pr107541.c.
gcc/ChangeLog:
* range-op.cc (operator_div::fold_range): Call
update_known_bitmask.
* tree-ssa-ccp.cc (bit_value_binop): Handle divisions by powers of
2 as a right shift.
Diffstat (limited to 'gcc/gimple-low.cc')
0 files changed, 0 insertions, 0 deletions