forked from OSchip/llvm-project
[VectorCombine] Avoid ConstantExpr::get() (NFC)
Use IRBuilder APIs instead, which will still constant fold.
This commit is contained in:
parent
98007e9753
commit
bdba8278d9
|
@ -697,8 +697,9 @@ bool VectorCombine::scalarizeBinopOrCmp(Instruction &I) {
|
|||
ScalarInst->copyIRFlags(&I);
|
||||
|
||||
// Fold the vector constants in the original vectors into a new base vector.
|
||||
Constant *NewVecC = IsCmp ? ConstantExpr::getCompare(Pred, VecC0, VecC1)
|
||||
: ConstantExpr::get(Opcode, VecC0, VecC1);
|
||||
Value *NewVecC =
|
||||
IsCmp ? Builder.CreateCmp(Pred, VecC0, VecC1)
|
||||
: Builder.CreateBinOp((Instruction::BinaryOps)Opcode, VecC0, VecC1);
|
||||
Value *Insert = Builder.CreateInsertElement(NewVecC, Scalar, Index);
|
||||
replaceValue(I, *Insert);
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue