@@ -3698,22 +3698,23 @@ bool isHeaderMask(VPValue *V, VPlan &Plan);
3698
3698
// / if it is either defined outside the vector region or its operand is known to
3699
3699
// / be uniform across all VFs and UFs (e.g. VPDerivedIV or VPCanonicalIVPHI).
3700
3700
inline bool isUniformAcrossVFsAndUFs (VPValue *V) {
3701
- if (auto *VPI = dyn_cast_or_null<VPInstruction>(V->getDefiningRecipe ())) {
3702
- return VPI ==
3703
- VPI->getParent ()->getPlan ()->getCanonicalIV ()->getBackedgeValue ();
3704
- }
3701
+ if (V->isLiveIn ())
3702
+ return true ;
3705
3703
if (isa<VPCanonicalIVPHIRecipe, VPDerivedIVRecipe, VPExpandSCEVRecipe>(V))
3706
3704
return true ;
3705
+ auto *R = cast<VPSingleDefRecipe>(V->getDefiningRecipe ());
3706
+ if (R == R->getParent ()->getPlan ()->getCanonicalIV ()->getBackedgeValue ())
3707
+ return true ;
3707
3708
if (isa<VPReplicateRecipe>(V) && cast<VPReplicateRecipe>(V)->isUniform () &&
3708
3709
(isa<LoadInst, StoreInst>(V->getUnderlyingValue ())) &&
3709
3710
all_of (V->getDefiningRecipe ()->operands (),
3710
3711
[](VPValue *Op) { return Op->isDefinedOutsideVectorRegions (); }))
3711
3712
return true ;
3712
3713
3713
- auto *C = dyn_cast_or_null <VPScalarCastRecipe>(V-> getDefiningRecipe ());
3714
- return C && (C ->isDefinedOutsideVectorRegions () ||
3715
- isa<VPDerivedIVRecipe>(C ->getOperand (0 )) ||
3716
- isa<VPCanonicalIVPHIRecipe>(C ->getOperand (0 )));
3714
+ return isa <VPScalarCastRecipe, VPWidenCastRecipe>(R) &&
3715
+ (R ->isDefinedOutsideVectorRegions () || R-> getOperand ( 0 )-> isLiveIn () ||
3716
+ isa<VPDerivedIVRecipe>(R ->getOperand (0 )) ||
3717
+ isa<VPCanonicalIVPHIRecipe>(R ->getOperand (0 )));
3717
3718
}
3718
3719
3719
3720
} // end namespace vputils
0 commit comments