[flang-commits] [flang] [flang] Emit `fir.global` in the global address space (PR #146653)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed Jul 2 02:35:35 PDT 2025
================
@@ -1867,6 +1867,20 @@ fir::factory::deduceOptimalExtents(mlir::ValueRange extents1,
return extents;
}
+uint64_t fir::factory::getGlobalAddressSpace(mlir::DataLayout *dataLayout) {
+ if (dataLayout)
+ if (mlir::Attribute addrSpace = dataLayout->getGlobalMemorySpace())
+ return mlir::cast<mlir::IntegerAttr>(addrSpace).getUInt();
+ return 0;
----------------
tblah wrote:
Yes lots of flang lit tests do not have data layout strings. It would be inconvenient to add them.
https://github.com/llvm/llvm-project/pull/146653
More information about the flang-commits
mailing list