[llvm-branch-commits] [llvm] [LoopInterchange] Bail out if function that may diverge is called (PR #201348)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jun 3 06:06:02 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)) {
-        // Functions which don't access memory do not prevent interchanging.
-        if (CI->doesNotAccessMemory() || isa<PseudoProbeInst>(CI))
+        // Functions which don't access memory and doesn't diverge do not
----------------
nikic wrote:

```suggestion
        // Functions which don't access memory and don't diverge do not
```

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


More information about the llvm-branch-commits mailing list