[llvm] [LoopInterchange] Require unordered load/store (PR #146143)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 12:24:02 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>

To match DependenceAnalysis' handling of unordered loads/stores, permit exactly this condition in LoopInterchange.

---
Full diff: https://github.com/llvm/llvm-project/pull/146143.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Scalar/LoopInterchange.cpp (+2-2) 


``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 9e3b4b82cc454..4d6efb051a773 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -141,11 +141,11 @@ static bool populateDependencyMatrix(CharMatrix &DepMatrix, unsigned Level,
       if (!isa<Instruction>(I))
         return false;
       if (auto *Ld = dyn_cast<LoadInst>(&I)) {
-        if (!Ld->isSimple())
+        if (!Ld->isUnordered())
           return false;
         MemInstr.push_back(&I);
       } else if (auto *St = dyn_cast<StoreInst>(&I)) {
-        if (!St->isSimple())
+        if (!St->isUnordered())
           return false;
         MemInstr.push_back(&I);
       }

``````````

</details>


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


More information about the llvm-commits mailing list