forked from OSchip/llvm-project
[NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftInput()
llvm-svn: 375153
This commit is contained in:
parent
8a3d7c9cbd
commit
31a691e2a2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue