[llvm] [LoopFusion] Allow fusing adjacent loops with same-iteration scalar deps (PR #216242)
Anchu Rajendran S via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 14 13:52:21 PDT 2026
================
@@ -0,0 +1,80 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -passes=loop-simplify,loop-fusion -stats -disable-output < %s 2>&1 | FileCheck %s --check-prefix=STAT
+; RUN: opt -S -passes=loop-simplify,loop-fusion < %s | FileCheck %s
+; STAT: 1 loop-fusion{{.*}} - Loops fused
+
+; Two adjacent loops: store then read-modify-write on the same array element.
+
+define void @store_then_accumulate(ptr noalias nocapture %hist, ptr noalias nocapture readonly %A, ptr noalias nocapture readonly %C, i64 %n, float %w0, float %w1) {
----------------
anchuraj wrote:
Thank you for pointing this out. I have simplified the testcase
https://github.com/llvm/llvm-project/pull/216242
More information about the llvm-commits
mailing list