mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple
ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -625,7 +625,7 @@ unsigned llvm::ComputeNumSignBits(Value *V, TargetData *TD, unsigned Depth) {
|
||||
if (Tmp == 1) return 1; // Early out.
|
||||
|
||||
// Special case decrementing a value (ADD X, -1):
|
||||
if (ConstantInt *CRHS = dyn_cast<ConstantInt>(U->getOperand(0)))
|
||||
if (ConstantInt *CRHS = dyn_cast<ConstantInt>(U->getOperand(1)))
|
||||
if (CRHS->isAllOnesValue()) {
|
||||
APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0);
|
||||
APInt Mask = APInt::getAllOnesValue(TyBits);
|
||||
|
Reference in New Issue
Block a user