Skip to content

Commit 79bd1d8

Browse files
committed
[SLPVectorizer] Avoid use of ConstantExpr::getIntegerCast() (NFC)
We are working on a ConstantInt here, so folding will always succeed. This just avoids use of the ConstantExpr API.
1 parent 3a2fbf5 commit 79bd1d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "llvm/Analysis/AliasAnalysis.h"
3535
#include "llvm/Analysis/AssumptionCache.h"
3636
#include "llvm/Analysis/CodeMetrics.h"
37+
#include "llvm/Analysis/ConstantFolding.h"
3738
#include "llvm/Analysis/DemandedBits.h"
3839
#include "llvm/Analysis/GlobalsModRef.h"
3940
#include "llvm/Analysis/IVDescriptors.h"
@@ -6286,8 +6287,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
62866287
if (!CI)
62876288
Operands.back().push_back(Op);
62886289
else
6289-
Operands.back().push_back(ConstantExpr::getIntegerCast(
6290-
CI, Ty, CI->getValue().isSignBitSet()));
6290+
Operands.back().push_back(ConstantFoldIntegerCast(
6291+
CI, Ty, CI->getValue().isSignBitSet(), *DL));
62916292
}
62926293
TE->setOperand(IndexIdx, Operands.back());
62936294

0 commit comments

Comments
 (0)