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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 12:23:30 PDT 2025


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

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

>From bcdb9386372b42fb7cfb45e7064864e55535d3c6 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
Date: Fri, 27 Jun 2025 20:18:23 +0100
Subject: [PATCH] [LoopInterchange] Require unordered load/store

To match DependenceAnalysis' handling of unordered loads/stores, permit
exactly this condition in LoopInterchange.
---
 llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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);
       }



More information about the llvm-commits mailing list