[llvm] 79bd1d8 - [SLPVectorizer] Avoid use of ConstantExpr::getIntegerCast() (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 04:27:41 PDT 2023
Author: Nikita Popov
Date: 2023-11-01T12:25:55+01:00
New Revision: 79bd1d8a9521d0efc99a1717aa80e5b4ea8046fd
URL: https://github.com/llvm/llvm-project/commit/79bd1d8a9521d0efc99a1717aa80e5b4ea8046fd
DIFF: https://github.com/llvm/llvm-project/commit/79bd1d8a9521d0efc99a1717aa80e5b4ea8046fd.diff
LOG: [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.
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 58974eefc4df580..80487d5861a42cd 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -34,6 +34,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CodeMetrics.h"
+#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/DemandedBits.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/IVDescriptors.h"
@@ -6286,8 +6287,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
if (!CI)
Operands.back().push_back(Op);
else
- Operands.back().push_back(ConstantExpr::getIntegerCast(
- CI, Ty, CI->getValue().isSignBitSet()));
+ Operands.back().push_back(ConstantFoldIntegerCast(
+ CI, Ty, CI->getValue().isSignBitSet(), *DL));
}
TE->setOperand(IndexIdx, Operands.back());
More information about the llvm-commits
mailing list