File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -7098,10 +7098,9 @@ class HorizontalReduction {
7098
7098
// select, we also have to RAUW for the compare instruction feeding the
7099
7099
// reduction root. That's because the original compare may have extra uses
7100
7100
// besides the final select of the reduction.
7101
- if (isa <SelectInst>(ReductionRoot)) {
7101
+ if (auto *ScalarSelect = dyn_cast <SelectInst>(ReductionRoot)) {
7102
7102
if (auto *VecSelect = dyn_cast<SelectInst>(VectorizedTree)) {
7103
- Instruction *ScalarCmp =
7104
- getCmpForMinMaxReduction (cast<Instruction>(ReductionRoot));
7103
+ Instruction *ScalarCmp = getCmpForMinMaxReduction (ScalarSelect);
7105
7104
ScalarCmp->replaceAllUsesWith (VecSelect->getCondition ());
7106
7105
}
7107
7106
}
You can’t perform that action at this time.
0 commit comments