[llvm] c9a87b4 - [VPlan] Retrieve latch terminator from VPlan. (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 27 01:51:39 PDT 2025


Author: Florian Hahn
Date: 2025-07-27T09:48:59+01:00
New Revision: c9a87b45a355d4f60cb6a06099e47a8ccaea7c63

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

LOG: [VPlan] Retrieve latch terminator from VPlan. (NFC)

Remove an unnecessary lookup via original IR loop.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
index 6e566e4807dff..5fac2a8f6b992 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
@@ -566,7 +566,7 @@ void VPlanTransforms::prepareForVectorization(
   // the corresponding compare because they may have ended up with 
diff erent
   // line numbers and we want to avoid awkward line stepping while debugging.
   // E.g., if the compare has got a line number inside the loop.
-  DebugLoc LatchDL = TheLoop->getLoopLatch()->getTerminator()->getDebugLoc();
+  DebugLoc LatchDL = LatchVPBB->getTerminator()->getDebugLoc();
   VPBuilder Builder(MiddleVPBB);
   VPValue *Cmp;
   if (!RequiresScalarEpilogueCheck)


        


More information about the llvm-commits mailing list