[Mlir-commits] [mlir] [MLIR][LLVM] Refactor globals insertion point in import (PR #127490)

Henrich Lauko llvmlistbot at llvm.org
Tue Feb 18 07:52:20 PST 2025


================
@@ -996,11 +1001,7 @@ LogicalResult ModuleImport::convertAlias(llvm::GlobalAlias *alias) {
 
 LogicalResult ModuleImport::convertGlobal(llvm::GlobalVariable *globalVar) {
   // Insert the global after the last one or at the start of the module.
-  OpBuilder::InsertionGuard guard(builder);
-  if (!globalInsertionOp)
-    builder.setInsertionPointToStart(mlirModule.getBody());
-  else
-    builder.setInsertionPointAfter(globalInsertionOp);
+  OpBuilder::InsertionGuard guard = setGlobalInsertionPoint(globalInsertionOp);
----------------
xlauko wrote:

Should be fixed.

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


More information about the Mlir-commits mailing list