[NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftInput()

llvm-svn: 375153
This commit is contained in:
Roman Lebedev 2019-10-17 18:30:03 +00:00
parent 8a3d7c9cbd
commit 31a691e2a2
1 changed files with 4 additions and 4 deletions

View File

@ -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;