Skip to content

Commit 1c16e5c

Browse files
committed
apply comment
1 parent 5305e37 commit 1c16e5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8152,8 +8152,9 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
81528152
}
81538153

81548154
// Don't handle scalable vectors
8155-
if (auto *EE = dyn_cast_if_present<ExtractElementInst>(S.getMainOp());
8156-
EE && isa<ScalableVectorType>(EE->getVectorOperandType())) {
8155+
if (S && S.getOpcode() == Instruction::ExtractElement &&
8156+
isa<ScalableVectorType>(
8157+
cast<ExtractElementInst>(S.getMainOp())->getVectorOperandType())) {
81578158
LLVM_DEBUG(dbgs() << "SLP: Gathering due to scalable vector type.\n");
81588159
if (TryToFindDuplicates(S))
81598160
newTreeEntry(VL, std::nullopt /*not vectorized*/, S, UserTreeIdx,
@@ -8248,7 +8249,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
82488249
SortedIndices));
82498250
bool AreAllSameInsts = AreAllSameBlock || AreScatterAllGEPSameBlock;
82508251
if (!AreAllSameInsts || (!S && allConstant(VL)) || isSplat(VL) ||
8251-
(isa_and_present<InsertElementInst, ExtractValueInst, ExtractElementInst>(
8252+
(S &&
8253+
isa<InsertElementInst, ExtractValueInst, ExtractElementInst>(
82528254
S.getMainOp()) &&
82538255
!all_of(VL, isVectorLikeInstWithConstOps)) ||
82548256
NotProfitableForVectorization(VL)) {

0 commit comments

Comments
 (0)