[Mlir-commits] [mlir] [MLIR][LLVM] Implement LLVM dialect support for global aliases (PR #125295)

Bruno Cardoso Lopes llvmlistbot at llvm.org
Tue Feb 4 11:53:18 PST 2025


================
@@ -1135,9 +1145,32 @@ LogicalResult ModuleTranslation::convertGlobals() {
     }
   }
 
-  // Convert global variable bodies. This is done after all global variables
-  // have been created in LLVM IR because a global body may refer to another
-  // global or itself. So all global variables need to be mapped first.
+  // Create all llvm::GlobalAlias
+  for (auto op : getModuleBody(mlirModule).getOps<LLVM::AliasOp>()) {
+    llvm::Type *type = convertType(op.getType());
+    llvm::Constant *cst = nullptr;
+    auto linkage = convertLinkageToLLVM(op.getLinkage());
----------------
bcardosolopes wrote:

Doing my best to remove them, just annoying given the whole file is tainted with those and there was a lot of copy n paste, as maintainers you might wanna consider cleaning the file up

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


More information about the Mlir-commits mailing list