[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


================
@@ -110,6 +113,9 @@ func.func private @_test_no_inline_copy_in(%arg0: !fir.box<!fir.array<?x?x?xf64>
   fir.call @_QFPsb(%18, %19#1) fastmath<contract> : (!fir.ref<!fir.array<?xf64>>, !fir.ref<i32>) -> ()
   hlfir.copy_out %0, %17#1 to %16 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?xf64>>>>, i1, !fir.box<!fir.array<?xf64>>) -> ()
   hlfir.end_associate %19#1, %19#2 : !fir.ref<i32>, i1
+  // Keep %0 live to avoid DCE after inlining.
----------------
vzakhari wrote:

Same here: no need for a fake use.

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


More information about the flang-commits mailing list