File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff 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:
You can’t perform that action at this time.
0 commit comments