Skip to content

Commit

Permalink
[VPlan] Remember previous loop and reset vector loop.
Browse files Browse the repository at this point in the history
At the moment this is NFC, but will be needed once nested loops are also
modeled as regions. Preparation for D123005.
  • Loading branch information
fhahn committed Apr 4, 2022
1 parent a5c3b57 commit 8cd1892
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Transforms/Vectorize/VPlan.cpp
Expand Up @@ -453,6 +453,7 @@ void VPRegionBlock::execute(VPTransformState *State) {

if (!isReplicator()) {
// Create and register the new vector loop.
Loop *PrevLoop = State->CurrentVectorLoop;
State->CurrentVectorLoop = State->LI->AllocateLoop();
Loop *ParentLoop = State->LI->getLoopFor(State->CFG.VectorPreHeader);

Expand Down Expand Up @@ -482,6 +483,8 @@ void VPRegionBlock::execute(VPTransformState *State) {
LLVM_DEBUG(dbgs() << "LV: VPBlock in RPO " << Block->getName() << '\n');
Block->execute(State);
}

State->CurrentVectorLoop = PrevLoop;
return;
}

Expand Down

0 comments on commit 8cd1892

Please sign in to comment.