[LV] Fetch vector loop region once and remember it (NFC).

This avoids an unnecessary lookup and makes the code slightly more
compact.
This commit is contained in:
Florian Hahn 2022-05-17 15:57:23 +01:00
parent c8cb644185
commit 5b00d13c00
No known key found for this signature in database
GPG Key ID: EEF712BB5E80EBBA
1 changed files with 3 additions and 4 deletions

View File

@ -10634,13 +10634,12 @@ bool LoopVectorizePass::processLoop(Loop *L) {
Checks); Checks);
VPlan &BestEpiPlan = LVP.getBestPlanFor(EPI.EpilogueVF); VPlan &BestEpiPlan = LVP.getBestPlanFor(EPI.EpilogueVF);
BestEpiPlan.getVectorLoopRegion()->getEntryBasicBlock()->setName( VPRegionBlock *VectorLoop = BestEpiPlan.getVectorLoopRegion();
"vec.epilog.vector.body"); VectorLoop->getEntryBasicBlock()->setName("vec.epilog.vector.body");
// Ensure that the start values for any VPReductionPHIRecipes are // Ensure that the start values for any VPReductionPHIRecipes are
// updated before vectorising the epilogue loop. // updated before vectorising the epilogue loop.
VPBasicBlock *Header = VPBasicBlock *Header = VectorLoop->getEntryBasicBlock();
BestEpiPlan.getVectorLoopRegion()->getEntryBasicBlock();
for (VPRecipeBase &R : Header->phis()) { for (VPRecipeBase &R : Header->phis()) {
if (auto *ReductionPhi = dyn_cast<VPReductionPHIRecipe>(&R)) { if (auto *ReductionPhi = dyn_cast<VPReductionPHIRecipe>(&R)) {
if (auto *Resume = MainILV.getReductionResumeValue( if (auto *Resume = MainILV.getReductionResumeValue(