diff options
author | Aethezz <64500703+Aethezz@users.noreply.github.com> | 2025-09-05 10:48:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-05 16:48:57 +0200 |
commit | ef1539c1d4e205b05bd8662c9d4e90382d2381a5 (patch) | |
tree | 8ba2a620537746f98991b9f1d4928a73d54dbc77 /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | caf5fb1c400bb825c90193719806ac373e94a981 (diff) | |
download | llvm-ef1539c1d4e205b05bd8662c9d4e90382d2381a5.zip llvm-ef1539c1d4e205b05bd8662c9d4e90382d2381a5.tar.gz llvm-ef1539c1d4e205b05bd8662c9d4e90382d2381a5.tar.bz2 |
[InstCombine] Fold out-of-range bits for squaring signed integers (#153484)
Fixes an issue where bits next to the sign bit were not constant-folded
when squaring a sign- or zero-extended small integer. Added logic to
detect when both operands of a multiplication are the same extended
value, allowing InstCombine to mark bits above the maximum possible
square as known zero. This enables correct folding of (x * x) & (1 << N)
to 0 when N is out of range.
Proof: https://alive2.llvm.org/ce/z/YGou44
Fixes #152061
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
0 files changed, 0 insertions, 0 deletions