[Mlir-commits] [mlir] [mlir][gpu] `gpu-module-to-binary`: add option to dump intermediate files (PR #170016)

Fabian Mora llvmlistbot at llvm.org
Sun Nov 30 08:58:30 PST 2025


================
@@ -143,7 +143,11 @@ LogicalResult ModuleToObject::loadBitcodeFilesFromList(
 
 std::unique_ptr<llvm::Module>
 ModuleToObject::translateToLLVMIR(llvm::LLVMContext &llvmContext) {
-  return translateModuleToLLVMIR(&getOperation(), llvmContext);
+  Operation &op = getOperation();
+  // Try to get nicer name from the operation.
+  auto nameAttr = op.getAttrOfType<StringAttr>("sym_name");
+  StringRef name = nameAttr ? nameAttr.getValue() : "LLVMDialectModule";
----------------
fabianmcg wrote:

Let's not use `sym_name` directly, this omits ops using properties.

```suggestion
  StringRef name = "LLVMDialectModule";
  // Try to get nicer name from the operation.
  if (auto symOp = dyn_cast<SymbolOpInterface>(op); symOp && symOp.getNameAttr())
    name = symOp.getNameAttr().getValue();
```

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


More information about the Mlir-commits mailing list