@@ -41,22 +41,21 @@ inline bool isUniformAfterVectorization(const VPValue *VPV) {
4141 // vectorization inside a vector region.
4242 if (VPV->isDefinedOutsideLoopRegions ())
4343 return true ;
44- const VPRecipeBase *Def = VPV->getDefiningRecipe ();
45- assert (Def && " Must have definition for value defined inside vector region" );
46- if (auto *Rep = dyn_cast<VPReplicateRecipe>(Def))
44+ if (auto *Rep = dyn_cast<VPReplicateRecipe>(VPV))
4745 return Rep->isUniform ();
48- if (isa<VPWidenGEPRecipe, VPDerivedIVRecipe>(Def))
49- return all_of (Def->operands (), isUniformAfterVectorization);
50- if (auto *VPI = dyn_cast<VPInstruction>(Def))
46+ if (isa<VPWidenGEPRecipe, VPDerivedIVRecipe>(VPV))
47+ return all_of (VPV->getDefiningRecipe ()->operands (),
48+ isUniformAfterVectorization);
49+ if (auto *VPI = dyn_cast<VPInstruction>(VPV))
5150 return VPI->isSingleScalar () || VPI->isVectorToScalar () ||
5251 ((Instruction::isBinaryOp (VPI->getOpcode ()) ||
5352 VPI->getOpcode () == VPInstruction::PtrAdd) &&
5453 all_of (VPI->operands (), isUniformAfterVectorization));
55- if (auto *IV = dyn_cast<VPDerivedIVRecipe>(Def ))
54+ if (auto *IV = dyn_cast<VPDerivedIVRecipe>(VPV ))
5655 return all_of (IV->operands (), isUniformAfterVectorization);
5756
5857 // VPExpandSCEVRecipes must be placed in the entry and are alway uniform.
59- return isa<VPExpandSCEVRecipe>(Def );
58+ return isa<VPExpandSCEVRecipe>(VPV );
6059}
6160
6261// / Return true if \p V is a header mask in \p Plan.
0 commit comments