We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cca8e4 commit 4fcf028Copy full SHA for 4fcf028
flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp
@@ -352,6 +352,14 @@ getBaseRef(mlir::TypedValue<mlir::acc::PointerLikeType> varPtr) {
352
// calculation op.
353
mlir::Value baseRef =
354
llvm::TypeSwitch<mlir::Operation *, mlir::Value>(op)
355
+ .Case<fir::DeclareOp>([&](auto op) {
356
+ // If this declare binds a view with an underlying storage operand,
357
+ // treat that storage as the base reference. Otherwise, fall back
358
+ // to the declared memref.
359
+ if (auto storage = op.getStorage())
360
+ return storage;
361
+ return op.getMemref();
362
+ })
363
.Case<hlfir::DesignateOp>([&](auto op) {
364
// Get the base object.
365
return op.getMemref();
0 commit comments