mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Move ashr optimization from InstCombineShift to InstSimplify.
Refactor code, no functionality change, test case moved from instcombine to instsimplify. Differential Revision: http://reviews.llvm.org/D4102 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213231 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1346,6 +1346,11 @@ static Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact,
|
||||
cast<OverflowingBinaryOperator>(Op0)->hasNoSignedWrap())
|
||||
return X;
|
||||
|
||||
// Arithmetic shifting an all-sign-bit value is a no-op.
|
||||
unsigned NumSignBits = ComputeNumSignBits(Op0);
|
||||
if (NumSignBits == Op0->getType()->getScalarSizeInBits())
|
||||
return Op0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user