[llvm-branch-commits] [llvm] [LoopInterchange] Prevent interchange when memory-accessing calls exist (PR #200828)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 1 08:08:08 PDT 2026


================
@@ -1474,8 +1474,10 @@ bool LoopInterchangeLegality::canInterchangeLoops(unsigned InnerLoopId,
   for (auto *BB : OuterLoop->blocks())
     for (Instruction &I : *BB)
       if (CallInst *CI = dyn_cast<CallInst>(&I)) {
-        // readnone functions do not prevent interchanging.
-        if (CI->onlyWritesMemory() || isa<PseudoProbeInst>(CI))
+        if (isa<PseudoProbeInst>(CI))
+          continue;
+        // Functions which don't access memories do not prevent interchanging.
----------------
nikic wrote:

```suggestion
        // Functions which don't access memory do not prevent interchanging.
```

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


More information about the llvm-branch-commits mailing list