[llvm] f9120dc - [VPlan] Make sure vector trip count is ready for prepareToExecute (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 12:44:34 PST 2024


Author: Florian Hahn
Date: 2024-12-16T20:44:20Z
New Revision: f9120dc2a60aedcab5ce99e40b6a2bd3849f0bb9

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

LOG: [VPlan] Make sure vector trip count is ready for prepareToExecute (NFC)

Split off from https://github.com/llvm/llvm-project/pull/112145. This
ensures that getOrCreateVectorTripCount creates the trip count as needed
when induction resume value creation is moved to VPlan and no longer
creates the vector trip count early.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index b364af3a1cf702..3abe655c0fc99f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7827,8 +7827,9 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   //===------------------------------------------------===//
 
   // 2. Copy and widen instructions from the old loop into the new loop.
-  BestVPlan.prepareToExecute(ILV.getTripCount(),
-                             ILV.getOrCreateVectorTripCount(nullptr), State);
+  BestVPlan.prepareToExecute(
+      ILV.getTripCount(),
+      ILV.getOrCreateVectorTripCount(ILV.LoopVectorPreHeader), State);
 
   BestVPlan.execute(&State);
 


        


More information about the llvm-commits mailing list