Skip to content

Commit 0b402e9

Browse files
committed
[InstCombine] FoldShiftByConstant - remove unnecessary cast<>. NFC.
Op1 is already a Constant*
1 parent 7bbb65b commit 0b402e9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,7 @@ Instruction *InstCombinerImpl::FoldShiftByConstant(Value *Op0, Constant *Op1,
693693
if (TrOp && I.isLogicalShift() && TrOp->isShift() &&
694694
isa<ConstantInt>(TrOp->getOperand(1))) {
695695
// Okay, we'll do this xform. Make the shift of shift.
696-
Constant *ShAmt =
697-
ConstantExpr::getZExt(cast<Constant>(Op1), TrOp->getType());
696+
Constant *ShAmt = ConstantExpr::getZExt(Op1, TrOp->getType());
698697
// (shift2 (shift1 & 0x00FF), c2)
699698
Value *NSh = Builder.CreateBinOp(I.getOpcode(), TrOp, ShAmt, I.getName());
700699

0 commit comments

Comments
 (0)