diff options
author | dzhao.ampere <di.zhao@amperecomputing.com> | 2024-05-10 11:55:18 +0800 |
---|---|---|
committer | Di Zhao <dizhao@os.amperecomputing.com> | 2024-05-11 17:59:12 +0800 |
commit | 1b0919cd147a2b6ccdee2b1217bf0200bdcc87aa (patch) | |
tree | aa44eb31cfc9ffd4a843079a00586d36db086cbb /gcc/dwarf2codeview.cc | |
parent | 18c93c65a9fbaaf3762198e78fb3c24b9b6fd9fc (diff) | |
download | gcc-1b0919cd147a2b6ccdee2b1217bf0200bdcc87aa.zip gcc-1b0919cd147a2b6ccdee2b1217bf0200bdcc87aa.tar.gz gcc-1b0919cd147a2b6ccdee2b1217bf0200bdcc87aa.tar.bz2 |
tree-optimization/114760 - check variants of >> and << in loop-niter
When recognizing bit counting idiom, include pattern "x * 2"
for "x << 1", and "x / 2" for "x >> 1" (given x is unsigned).
gcc/ChangeLog:
PR tree-optimization/114760
* tree-ssa-loop-niter.cc (is_lshift_by_1): New function
to check if STMT is equivalent to x << 1.
(is_rshift_by_1): New function to check if STMT is
equivalent to x >> 1.
(number_of_iterations_cltz): Enhance the identification
of logical shift by one.
(number_of_iterations_cltz_complement): Enhance the
identification of logical shift by one.
gcc/testsuite/ChangeLog:
PR tree-optimization/114760
* gcc.dg/tree-ssa/pr114760-1.c: New test.
* gcc.dg/tree-ssa/pr114760-2.c: New test.
Diffstat (limited to 'gcc/dwarf2codeview.cc')
0 files changed, 0 insertions, 0 deletions