[LV] Minor code restructure of isUniformAfterVectorization [nfc]

Mostly just to make a future patch easier to review.
This commit is contained in:
Philip Reames 2022-08-29 12:47:56 -07:00 committed by Philip Reames
parent 54e17931a6
commit 033a97a8f3
1 changed files with 7 additions and 2 deletions

View File

@ -3048,8 +3048,13 @@ VPValue *getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,
/// Returns true if \p VPV is uniform after vectorization.
inline bool isUniformAfterVectorization(VPValue *VPV) {
auto RepR = dyn_cast_or_null<VPReplicateRecipe>(VPV->getDef());
return !VPV->getDef() || (RepR && RepR->isUniform());
if (auto *Def = VPV->getDef()) {
if (auto Rep = dyn_cast<VPReplicateRecipe>(Def))
return Rep->isUniform();
return false;
}
// A value without a def is external to vplan and thus uniform.
return true;
}
} // end namespace vputils