[Mlir-commits] [mlir] [MLIR][LLVMIR] Handle MDTuple-of-MDStrings module flags (e.g. riscv-isa) (PR #188741)
Mehdi Amini
llvmlistbot at llvm.org
Mon Apr 13 04:01:25 PDT 2026
================
@@ -531,6 +531,12 @@ ModuleFlagAttr::verify(function_ref<InFlightDiagnostic()> emitError,
if (isa<IntegerAttr, StringAttr>(value))
return success();
+ // Allow ArrayAttr of StringAttrs to represent MDTuples of MDStrings
+ // (e.g. the "riscv-isa" module flag).
+ if (auto arrayAttr = dyn_cast<ArrayAttr>(value))
+ if (llvm::all_of(arrayAttr, [](Attribute a) { return isa<StringAttr>(a); }))
+ return success();
+
return emitError() << "only integer and string values are currently "
----------------
joker-eph wrote:
Updated the diagnostic.
I'm not sure about array of int, I would relax the verifier when we find a use-case?
https://github.com/llvm/llvm-project/pull/188741
More information about the Mlir-commits
mailing list