Skip to content

Commit 19bc07a

Browse files
artagnonaokblast
authored andcommitted
[VPlan] Use VPlan::getRegion to shorten code (NFC) (llvm#164287)
1 parent 23fc12d commit 19bc07a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,8 +2092,8 @@ struct VPCSEDenseMapInfo : public DenseMapInfo<VPSingleDefRecipe *> {
20922092
// Recipes in replicate regions implicitly depend on predicate. If either
20932093
// recipe is in a replicate region, only consider them equal if both have
20942094
// the same parent.
2095-
const VPRegionBlock *RegionL = L->getParent()->getParent();
2096-
const VPRegionBlock *RegionR = R->getParent()->getParent();
2095+
const VPRegionBlock *RegionL = L->getRegion();
2096+
const VPRegionBlock *RegionR = R->getRegion();
20972097
if (((RegionL && RegionL->isReplicator()) ||
20982098
(RegionR && RegionR->isReplicator())) &&
20992099
L->getParent() != R->getParent())
@@ -3867,8 +3867,7 @@ void VPlanTransforms::materializePacksAndUnpacks(VPlan &Plan) {
38673867
// required lanes implicitly.
38683868
// TODO: Remove once replicate regions are unrolled completely.
38693869
auto IsCandidateUnpackUser = [Def](VPUser *U) {
3870-
VPRegionBlock *ParentRegion =
3871-
cast<VPRecipeBase>(U)->getParent()->getParent();
3870+
VPRegionBlock *ParentRegion = cast<VPRecipeBase>(U)->getRegion();
38723871
return U->usesScalars(Def) &&
38733872
(!ParentRegion || !ParentRegion->isReplicator());
38743873
};

0 commit comments

Comments
 (0)