diff options
author | Archibald Elliott <archibald.elliott@arm.com> | 2023-04-04 10:36:12 +0100 |
---|---|---|
committer | Archibald Elliott <archibald.elliott@arm.com> | 2023-04-12 17:38:39 +0100 |
commit | 17cd511007fd86cf2a4c5a6e20e1845eb5af3eb8 (patch) | |
tree | 6bfb636f7f45f008c9649486290e9504aab8d78e /llvm/lib/Object/ELF.cpp | |
parent | b3a4dbfd8a338e2a790ea27fefd34faeee3a7ada (diff) | |
download | llvm-17cd511007fd86cf2a4c5a6e20e1845eb5af3eb8.zip llvm-17cd511007fd86cf2a4c5a6e20e1845eb5af3eb8.tar.gz llvm-17cd511007fd86cf2a4c5a6e20e1845eb5af3eb8.tar.bz2 |
[DAGCombiner] Fix (shl (ctlz x) n) for non-power-of-two Data
This DAGCombine is not valid for some combinations of the known bits
of x and non-power-of-two widths of x. As shown in the bug:
- The bitwidth of x is 35 (n=5)
- The unknown bits of x is only the least significant bit
- This gives the result of the ctlz two possible values: 34 or 35, both
of which will give 1 when left-shifted 5 bits.
- So the `eor x, 1` that this optimisation would give is not correct.
A similar instcombine optimisation is only applied when the width of x is
a power-of-two. GlobalISel does not have this bug, as shown by the testcase.
Fixes #61549
Differential Revision: https://reviews.llvm.org/D147518
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
0 files changed, 0 insertions, 0 deletions