projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98007e9
)
[VectorCombine] Avoid ConstantExpr::get() (NFC)
author
Nikita Popov
<npopov@redhat.com>
Wed, 29 Jun 2022 15:17:20 +0000
(17:17 +0200)
committer
Nikita Popov
<npopov@redhat.com>
Wed, 29 Jun 2022 15:17:52 +0000
(17:17 +0200)
Use IRBuilder APIs instead, which will still constant fold.
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index
94c690a
..
9059893
100644
(file)
--- a/
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@
-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;