[flang-commits] [flang] [flang][HLFIR] Relax InlineElementals to support more than two users (PR #186916)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Fri May 8 09:22:37 PDT 2026


================
@@ -31,29 +33,265 @@ namespace hlfir {
 #include "flang/Optimizer/HLFIR/Passes.h.inc"
 } // namespace hlfir
 
+/// Collects all memory values (buffers/references) that the elemental body
+/// reads from. Use MemoryEffectOpInterface for a fail-safe implementation.
+static void getReadDependencies(hlfir::ElementalOp elemental,
+                                llvm::SmallVectorImpl<mlir::Value> &deps) {
----------------
tblah wrote:

nit: put these in a set so we don't do duplicate alias analysis queries

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


More information about the flang-commits mailing list