[flang-commits] [flang] [acc][flang] Checking scalar like variables when there's storage operand to fir.declare (PR #163439)

Susan Tan ス-ザン タン via flang-commits flang-commits at lists.llvm.org
Tue Oct 14 14:10:16 PDT 2025


================
@@ -353,6 +353,14 @@ getBaseRef(mlir::TypedValue<mlir::acc::PointerLikeType> varPtr) {
   // calculation op.
   mlir::Value baseRef =
       llvm::TypeSwitch<mlir::Operation *, mlir::Value>(op)
+          .Case<fir::DeclareOp>([&](auto op) {
+            // If this declare binds a view with an underlying storage operand,
+            // treat that storage as the base reference. Otherwise, fall back
+            // to the declared memref.
+            if (auto storage = op.getStorage())
+              return storage;
+            return op.getMemref();
----------------
SusanTan wrote:

for the record, agreement reached to not make this change and leave for furture MRs.

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


More information about the flang-commits mailing list