[llvm] [LoopNestAnalysis] Change the definition of perfect loop nest (NFC) (PR #206077)

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 11:10:08 PDT 2026


================
@@ -133,17 +119,15 @@ LoopNest::LoopNestEnum LoopNest::analyzeLoopNestForPerfectNest(
   }
 
   CmpInst *OuterLoopLatchCmp = getOuterLoopLatchCmp(OuterLoop);
-  CmpInst *InnerLoopGuardCmp = getInnerLoopGuardCmp(InnerLoop);
 
   // Determine whether instructions in a basic block are one of:
-  //  - the inner loop guard comparison
   //  - the outer loop latch comparison
   //  - the outer loop induction variable increment
   //  - a phi node, a cast or a branch
   auto containsOnlySafeInstructions = [&](const BasicBlock &BB) {
     return llvm::all_of(BB, [&](const Instruction &I) {
-      bool IsSafeInstr = checkSafeInstruction(I, InnerLoopGuardCmp,
-                                              OuterLoopLatchCmp, OuterLoopLB);
+      bool IsSafeInstr =
+          checkSafeInstruction(I, OuterLoopLatchCmp, OuterLoopLB);
       if (IsSafeInstr) {
----------------
amehsan wrote:

fixed

https://github.com/llvm/llvm-project/pull/206077


More information about the llvm-commits mailing list