Skip to content

Commit b9e1573

Browse files
committed
Address review comments
1 parent 19e3bee commit b9e1573

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,14 +4278,13 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor() {
42784278
if (!VPI)
42794279
continue;
42804280
switch (VPI->getOpcode()) {
4281-
// Selects are not modelled in the legacy cost model if they are
4282-
// inserted for reductions.
4281+
// Selects are only modelled in the legacy cost model for safe
4282+
// divisors.
42834283
case Instruction::Select: {
4284-
VPValue *V =
4285-
R.getNumDefinedValues() == 1 ? R.getVPSingleValue() : nullptr;
4286-
if (V && V->getNumUsers() == 1) {
4287-
if (auto *UR = dyn_cast<VPWidenRecipe>(*V->user_begin())) {
4288-
switch (UR->getOpcode()) {
4284+
VPValue *VPV = VPI->getVPSingleValue();
4285+
if (VPV->getNumUsers() == 1) {
4286+
if (auto *WR = dyn_cast<VPWidenRecipe>(*VPV->user_begin())) {
4287+
switch (WR->getOpcode()) {
42894288
case Instruction::UDiv:
42904289
case Instruction::SDiv:
42914290
case Instruction::URem:

0 commit comments

Comments
 (0)