[Mlir-commits] [mlir] [MLIR][LLVM] Implement LLVM dialect support for global aliases (PR #125295)
Christian Ulmann
llvmlistbot at llvm.org
Mon Feb 3 23:55:06 PST 2025
================
@@ -952,6 +962,42 @@ ModuleImport::getOrCreateNamelessSymbolName(llvm::GlobalVariable *globalVar) {
return symbolRef;
}
+LogicalResult ModuleImport::convertAlias(llvm::GlobalAlias *alias) {
+ // Insert the global after the last one or at the start of the module.
+ OpBuilder::InsertionGuard guard(builder);
+ if (!aliasInsertionOp)
+ builder.setInsertionPointToStart(mlirModule.getBody());
+ else
+ builder.setInsertionPointAfter(aliasInsertionOp);
+
+ Type type = convertType(alias->getValueType());
+ AliasOp aliasOp = builder.create<AliasOp>(
+ mlirModule.getLoc(), type, convertLinkageFromLLVM(alias->getLinkage()),
+ alias->getName(),
+ /*addr_space=*/alias->getAddressSpace(),
----------------
Dinistro wrote:
Can you check if this just falls back to reading the address space from the type or if this is really a value? As stated before, the LangRef does not mention any address space for aliases (not that this means anything...).
https://github.com/llvm/llvm-project/pull/125295
More information about the Mlir-commits
mailing list