[Mlir-commits] [mlir] [MLIR][LLVMIR] Handle MDTuple-of-MDStrings module flags (e.g. riscv-isa) (PR #188741)
Erich Keane
llvmlistbot at llvm.org
Wed Apr 1 06:37:57 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 "
----------------
erichkeane wrote:
I find myself wondering; if string, and int are fine. Why ONLY array of string (and not array of int?). Can we think of any uses for that?
https://github.com/llvm/llvm-project/pull/188741
More information about the Mlir-commits
mailing list