Skip to content

Commit b0797e0

Browse files
committed
[SLP] use dyn_cast instead of isa + cast; NFC
1 parent 571d5f9 commit b0797e0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7098,10 +7098,9 @@ class HorizontalReduction {
70987098
// select, we also have to RAUW for the compare instruction feeding the
70997099
// reduction root. That's because the original compare may have extra uses
71007100
// besides the final select of the reduction.
7101-
if (isa<SelectInst>(ReductionRoot)) {
7101+
if (auto *ScalarSelect = dyn_cast<SelectInst>(ReductionRoot)) {
71027102
if (auto *VecSelect = dyn_cast<SelectInst>(VectorizedTree)) {
7103-
Instruction *ScalarCmp =
7104-
getCmpForMinMaxReduction(cast<Instruction>(ReductionRoot));
7103+
Instruction *ScalarCmp = getCmpForMinMaxReduction(ScalarSelect);
71057104
ScalarCmp->replaceAllUsesWith(VecSelect->getCondition());
71067105
}
71077106
}

0 commit comments

Comments
 (0)