[all-commits] [llvm/llvm-project] 821ff7: [LoopInterchange] Supported partially-perfect Loop...

Rohit Garg via All-commits all-commits at lists.llvm.org
Thu Sep 10 19:12:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 821ff7cd6803d719515c2ae9ada665c4bc3c4c35
      https://github.com/llvm/llvm-project/commit/821ff7cd6803d719515c2ae9ada665c4bc3c4c35
  Author: Rohit Garg <rohgarg at qti.qualcomm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/bail-out-one-loop.ll
    A llvm/test/Transforms/LoopInterchange/confused-dependence-subnest.ll
    A llvm/test/Transforms/LoopInterchange/dependency-matrix-padding.ll
    M llvm/test/Transforms/LoopInterchange/large-nested-6d.ll
    A llvm/test/Transforms/LoopInterchange/missed-outer-prefix-subnest.ll
    A llvm/test/Transforms/LoopInterchange/no-partially-perfect-subnest.ll
    M llvm/test/Transforms/LoopInterchange/partially-perfect-loop.ll
    A llvm/test/Transforms/LoopInterchange/preserve-sibling-order.ll

  Log Message:
  -----------
  [LoopInterchange] Supported partially-perfect Loop Nests (#199511)

In the current implementation when the outermost loop contains sibling
sub-loops (i.e. multiple independent loop nests at the same depth), the
pass silently skips the entire loop nest without attempting to
interchange any of the valid sub-nests (See Below Example).

Example:
```
for(int i=0; i<n; i++){  // Loop 1
    for(int j=0; j<m; j++){  // Loop 2
         for(int r=0; r<m; r++){  // Loop 3
         // Do something
         }
    }
    for(int k=0; k<p; k++){  // Loop 4
        for(int l=0; l<p; l++){  // Loop 5
            //Access A[l][k]
        }
    }
}
```

In the Example , GCC 16 performs loop interchange on (Loop2, Loop3) or
(Loop4, Loop5), provided the interchange is both legal and profitable.

Fixes: https://github.com/llvm/llvm-project/issues/196006



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list