[Mlir-commits] [mlir] [mlir][llvm] adds an attribute for the module level assembly (PR #151318)

Christian Ulmann llvmlistbot at llvm.org
Wed Jul 30 09:09:26 PDT 2025


================
@@ -2276,6 +2276,13 @@ prepareLLVMModule(Operation *m, llvm::LLVMContext &llvmContext,
     llvmModule->setTargetTriple(
         llvm::Triple(cast<StringAttr>(targetTripleAttr).getValue()));
 
+  if (auto asmAttr =
+          m->getDiscardableAttr(LLVM::LLVMDialect::getModuleLevelAsmAttrName())) {
+    auto arr = cast<ArrayAttr>(asmAttr);
+    for (unsigned i = 0; i < arr.size(); ++i)
----------------
Dinistro wrote:

Nit: I would expect that this supports a range-based loop, thus I suggest to use that instead.

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


More information about the Mlir-commits mailing list