Skip to content

Commit 75dc9af

Browse files
committed
[SLP][NFC]Remove some dead code + reorder calls to avoid extra checks
1 parent 3bc38fb commit 75dc9af

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7126,8 +7126,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
71267126
}
71277127

71287128
// Don't handle vectors.
7129-
if (!SLPReVec && getValueType(S.OpValue)->isVectorTy() &&
7130-
!isa<InsertElementInst>(S.OpValue)) {
7129+
if (!SLPReVec && getValueType(S.OpValue)->isVectorTy()) {
71317130
LLVM_DEBUG(dbgs() << "SLP: Gathering due to vector type.\n");
71327131
newTreeEntry(VL, std::nullopt /*not vectorized*/, S, UserTreeIdx);
71337132
return;
@@ -13221,9 +13220,9 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
1322113220
}
1322213221

1322313222
Value *V = E->Scalars.front();
13224-
Type *ScalarTy = getValueType(V);
13225-
if (isa<CmpInst>(V))
13226-
ScalarTy = V->getType();
13223+
Type *ScalarTy = V->getType();
13224+
if (!isa<CmpInst>(V))
13225+
ScalarTy = getValueType(V);
1322713226
auto It = MinBWs.find(E);
1322813227
if (It != MinBWs.end()) {
1322913228
auto *VecTy = dyn_cast<FixedVectorType>(ScalarTy);

0 commit comments

Comments
 (0)