[flang-commits] [flang] [flang] Characterize allocation based on MemAlloc effect instead of pattern matching (PR #166806)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Fri Nov 7 16:04:05 PST 2025


================
@@ -11,6 +11,8 @@ omp.declare_reduction @test_reduction : !fir.ref<!fir.box<i32>> init {
 ^bb0(%arg0: !fir.ref<!fir.box<i32>>):
   %0 = fir.alloca !fir.box<i32>
   %1 = fir.alloca i32
+  %c0 = arith.constant 0 : i32
+  fir.store %c0 to %1 : !fir.ref<i32>
----------------
vzakhari wrote:

I do not understand why we need this.  Both `%0` and `%1` are directly or indirectly used by `fir.store`, so they should not become dead.

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


More information about the flang-commits mailing list