mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
type to truncate to should be the number of bits of the value that are preserved, not the number that are clobbered with sign-extension. This fixes regressions in ldecod. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2015,7 +2015,7 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
|
||||
if (Instruction *L = dyn_cast<Instruction>(U->getOperand(0)))
|
||||
if (L->getOpcode() == Instruction::Shl &&
|
||||
L->getOperand(1) == U->getOperand(1)) {
|
||||
uint64_t Amt = CI->getZExtValue();
|
||||
uint64_t Amt = getTypeSizeInBits(U->getType()) - CI->getZExtValue();
|
||||
return
|
||||
SE.getSignExtendExpr(SE.getTruncateExpr(getSCEV(L->getOperand(0)),
|
||||
IntegerType::get(Amt)),
|
||||
|
Reference in New Issue
Block a user