summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-10-17 18:30:03 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-10-17 18:30:03 +0000
commit31a691e2a2293a9ecb5330f081f2410bc1ff4474 (patch)
treed2c06d40919a3b035352f7d19fc0eb7e79fbe4b2
parent8a3d7c9cbd305764d1f6c2d42cdd82cf2876b99f (diff)
downloadbcm5719-llvm-31a691e2a2293a9ecb5330f081f2410bc1ff4474.tar.gz
bcm5719-llvm-31a691e2a2293a9ecb5330f081f2410bc1ff4474.zip
[NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftInput()
llvm-svn: 375153
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
index 11b7a165d6e..cc0e35e4a9c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
@@ -158,8 +158,8 @@ dropRedundantMaskingOfLeftShiftInput(BinaryOperator *OuterShift,
assert(OuterShift->getOpcode() == Instruction::BinaryOps::Shl &&
"The input must be 'shl'!");
- Value *Masked = OuterShift->getOperand(0);
- Value *ShiftShAmt = OuterShift->getOperand(1);
+ Value *Masked, *ShiftShAmt;
+ match(OuterShift, m_Shift(m_Value(Masked), m_Value(ShiftShAmt)));
Type *NarrowestTy = OuterShift->getType();
Type *WidestTy = Masked->getType();
@@ -252,8 +252,8 @@ dropRedundantMaskingOfLeftShiftInput(BinaryOperator *OuterShift,
}
// No 'NUW'/'NSW'! We no longer know that we won't shift-out non-0 bits.
- auto *NewShift =
- BinaryOperator::Create(OuterShift->getOpcode(), X, ShiftShAmt);
+ auto *NewShift = BinaryOperator::Create(OuterShift->getOpcode(), X,
+ OuterShift->getOperand(1));
if (!NeedMask)
return NewShift;
OpenPOWER on IntegriCloud