[llvm] 8cd1892 - [VPlan] Remember previous loop and reset vector loop.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 01:27:29 PDT 2022


Author: Florian Hahn
Date: 2022-04-04T09:27:15+01:00
New Revision: 8cd189272599b73398eee3b46b015070aa77b2f3

URL: https://github.com/llvm/llvm-project/commit/8cd189272599b73398eee3b46b015070aa77b2f3
DIFF: https://github.com/llvm/llvm-project/commit/8cd189272599b73398eee3b46b015070aa77b2f3.diff

LOG: [VPlan] Remember previous loop and reset vector loop.

At the moment this is NFC, but will be needed once nested loops are also
modeled as regions. Preparation for D123005.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 05a92cba79b21..50ac8d72bf7e1 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -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);
 
@@ -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;
   }
 


        


More information about the llvm-commits mailing list