diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 3a099af9e98..083acafe326 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5169,7 +5169,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) { if (((Tmp = dyn_cast(SVI->getOperand(0))) && Tmp->getOperand(0)->getType() == CI.getType()) || ((Tmp = dyn_cast(SVI->getOperand(1))) && - Tmp->getOperand(1)->getType() == CI.getType())) { + Tmp->getOperand(0)->getType() == CI.getType())) { Value *LHS = InsertOperandCastBefore(SVI->getOperand(0), CI.getType(), &CI); Value *RHS = InsertOperandCastBefore(SVI->getOperand(1),