aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2024-07-08 01:35:53 +0200
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2024-07-18 11:25:43 +0200
commitb8c4c58ecf186dd91f40bdff4d1bdad403435789 (patch)
tree229b347aefee7f72e82994e3ad043ee2c3aa36f4 /mlir/lib/Bytecode/Reader/BytecodeReader.cpp
parent783e07f3a4f4684613ffb4a442c97f25c83f309b (diff)
downloadllvm-b8c4c58ecf186dd91f40bdff4d1bdad403435789.zip
llvm-b8c4c58ecf186dd91f40bdff4d1bdad403435789.tar.gz
llvm-b8c4c58ecf186dd91f40bdff4d1bdad403435789.tar.bz2
[InstCombine] Turn AShr into LShr more often in SimplifyDemandedUseBits (#99155)
The functional change here is to undo "llvm-svn: 311773", aka D36936, aka commit 22178dd33b3460207b8. That patch avoided to convert AShr into LShr in SimplifyDemandedUseBits based on known sign bits analysis. Even if it would be legal to turn the shift into a logical shift (given by the fact that the shifted in bits wasn't demanded), that patch prevented converting the shift into LShr when any of the original sign bits were demanded. One side effect of the reverted functionalty was that the better we were at computing number of sign bits, the less likely it was that we would replace AShr by LShr during SimplifyDemandedUseBits. This was seen in https://github.com/llvm/llvm-project/pull/97693/ when an improvement of ComputeNumSignBits resulted in regressions due to no longer rewriting AShr to LShr. The test case from D36936 still passes after this commit. So it seems like at least the compiler has been taught how to optimize that scenario even if we do the AShr->LShr transform more aggressively.
Diffstat (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp')
0 files changed, 0 insertions, 0 deletions