Skip to content

Commit 401ffa6

Browse files
committed
Reuse createBinOpShuffle
1 parent 8522d21 commit 401ffa6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,13 +2286,9 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
22862286

22872287
Value *NewLHS = ConstOp1 ? V1 : NewC;
22882288
Value *NewRHS = ConstOp1 ? NewC : V1;
2289-
Value *XY = Builder.CreateBinOp(Opcode, NewLHS, NewRHS);
2290-
if (auto *BO = dyn_cast<BinaryOperator>(XY))
2291-
BO->copyIRFlags(&Inst);
2292-
22932289
VectorType *VTy = cast<VectorType>(Inst.getType());
2294-
SmallVector<int> NewM(VTy->getElementCount().getKnownMinValue(), 0);
2295-
return new ShuffleVectorInst(XY, NewM);
2290+
SmallVector<int> Mask(VTy->getElementCount().getKnownMinValue(), 0);
2291+
return createBinOpShuffle(NewLHS, NewRHS, Mask);
22962292
}
22972293
}
22982294

0 commit comments

Comments
 (0)