[flang-commits] [flang] [flang] Lowering FIR memory ops to MemRef dialect (PR #173507)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Wed Dec 24 14:55:11 PST 2025


================
@@ -0,0 +1,1171 @@
+//===-- FIRToMemRef.cpp - Convert FIR loads and stores to MemRef ---------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This pass lowers FIR dialect memory operations to the MemRef dialect.
+// It is adapted from the NVHPC FIRToMemRef implementation so that it can
+// be used as a regular flang/MLIR transform pass.
+//
+// In particular it:
+//
+//  - Rewrites `fir.alloca` to `memref.alloca`.
+//
+//  - Rewrites `fir.load` / `fir.store` to `memref.load` / `memref.store`.
+//
+//  - Marshals FIR reference-like values (boxes, array coordinates,
----------------
razvanlupusoru wrote:

Is this description accurate with regards to boxes?

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


More information about the flang-commits mailing list