File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1122,10 +1122,11 @@ bool VectorCombine::scalarizeOpOrCmp(Instruction &I) {
11221122 else if (isa<BinaryOperator>(I))
11231123 NewVecC = ConstantFoldBinaryOpOperands ((Instruction::BinaryOps)Opcode,
11241124 VecCs[0 ], VecCs[1 ], *DL);
1125- else if (isa<IntrinsicInst>(I) && cast<IntrinsicInst>(I).arg_size () == 2 )
1126- NewVecC =
1127- ConstantFoldBinaryIntrinsic (cast<IntrinsicInst>(I).getIntrinsicID (),
1128- VecCs[0 ], VecCs[1 ], I.getType (), &I);
1125+ else if (auto *II = dyn_cast<IntrinsicInst>(&I)) {
1126+ if (II->arg_size () == 2 )
1127+ NewVecC = ConstantFoldBinaryIntrinsic (II->getIntrinsicID (), VecCs[0 ],
1128+ VecCs[1 ], II->getType (), II);
1129+ }
11291130
11301131 // Get cost estimate for the insert element. This cost will factor into
11311132 // both sequences.
You can’t perform that action at this time.
0 commit comments