[llvm] [LoopInterchange] Bail out when finding a dependency with all `*` elements (PR #149049)

Madhur Amilkanthwar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 01:05:22 PDT 2025


================
@@ -260,6 +260,18 @@ static bool populateDependencyMatrix(CharMatrix &DepMatrix, unsigned Level,
           Dep.push_back('I');
         }
 
+        // If there is a direction vector with all entries being '*', we cannot
+        // prove the legality of the interchange for arbitrary pairs of loops.
+        // Exit early in this case to save compile time.
+        if (all_of(Dep, [](char C) { return C == '*'; })) {
----------------
madhur13490 wrote:

Can be reworded to the following for clarity.

// If all the elements of any direction vector have only '*', legality can't be proven.
// Exit early to save compile time.

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


More information about the llvm-commits mailing list