[llvm] e74a737 - [SLP][NFC]Minor code changes for better readability, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 13:00:55 PDT 2022
Author: Alexey Bataev
Date: 2022-05-02T12:58:25-07:00
New Revision: e74a73782f34771816ae1d87b52302c08f7f15c2
URL: https://github.com/llvm/llvm-project/commit/e74a73782f34771816ae1d87b52302c08f7f15c2
DIFF: https://github.com/llvm/llvm-project/commit/e74a73782f34771816ae1d87b52302c08f7f15c2.diff
LOG: [SLP][NFC]Minor code changes for better readability, NFC.
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 a17396e97ebb7..70788509d1070 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6351,10 +6351,10 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
ShuffleMask.emplace_back(VF.back(), UndefMaskElem);
// Find the insertvector, vectorized in tree, if any.
Value *Base = VU;
- while (isa<InsertElementInst>(Base)) {
+ while (auto *IEBase = dyn_cast<InsertElementInst>(Base)) {
// Build the mask for the vectorized insertelement instructions.
- if (const TreeEntry *E = getTreeEntry(Base)) {
- VU = cast<InsertElementInst>(Base);
+ if (const TreeEntry *E = getTreeEntry(IEBase)) {
+ VU = IEBase;
do {
int Idx = E->findLaneForValue(Base);
ShuffleMask.back()[Idx] = Idx;
@@ -6370,8 +6370,9 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
} else {
VecId = std::distance(FirstUsers.begin(), It);
}
- ShuffleMask[VecId][*InsertIdx] = EU.Lane;
- DemandedElts[VecId].setBit(*InsertIdx);
+ int InIdx = *InsertIdx;
+ ShuffleMask[VecId][InIdx] = EU.Lane;
+ DemandedElts[VecId].setBit(InIdx);
continue;
}
}
More information about the llvm-commits
mailing list