@@ -41,22 +41,21 @@ inline bool isUniformAfterVectorization(const VPValue *VPV) {
41
41
// vectorization inside a vector region.
42
42
if (VPV->isDefinedOutsideLoopRegions ())
43
43
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))
47
45
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))
51
50
return VPI->isSingleScalar () || VPI->isVectorToScalar () ||
52
51
((Instruction::isBinaryOp (VPI->getOpcode ()) ||
53
52
VPI->getOpcode () == VPInstruction::PtrAdd) &&
54
53
all_of (VPI->operands (), isUniformAfterVectorization));
55
- if (auto *IV = dyn_cast<VPDerivedIVRecipe>(Def ))
54
+ if (auto *IV = dyn_cast<VPDerivedIVRecipe>(VPV ))
56
55
return all_of (IV->operands (), isUniformAfterVectorization);
57
56
58
57
// VPExpandSCEVRecipes must be placed in the entry and are alway uniform.
59
- return isa<VPExpandSCEVRecipe>(Def );
58
+ return isa<VPExpandSCEVRecipe>(VPV );
60
59
}
61
60
62
61
// / Return true if \p V is a header mask in \p Plan.
0 commit comments