[Mlir-commits] [mlir] [MLIR][LLVMIR] Add module flags support (PR #130679)
Tobias Gysi
llvmlistbot at llvm.org
Tue Mar 11 01:06:48 PDT 2025
================
@@ -1267,4 +1267,30 @@ def WorkgroupAttributionAttr
let assemblyFormat = "`<` $num_elements `,` $element_type `>`";
}
+//===----------------------------------------------------------------------===//
+// ModuleFlagAttr
+//===----------------------------------------------------------------------===//
+
+def ModuleFlagAttr
+ : LLVM_Attr<"ModuleFlag", "mlir.module_flag"> {
+ let summary = "LLVM module flag metadata";
+ let description = [{
+ Represents a single entry of llvm.module.flags metadata
+ (llvm::Module::ModuleFlagEntry in LLVM). The first element is a behavior
+ flag described by `ModFlagBehaviorAttr`, the second is a string ID
+ and third is the value of the flag (currently only integer constant
+ supported).
+
+ Example:
+ ```mlir
+ #llvm.mlir.module_flag<1 : i64, "wchar_size", 4 : i32>
+ ]
+ ```
+ }];
+ let parameters = (ins "ModFlagBehaviorAttr":$behavior,
----------------
gysit wrote:
```suggestion
let parameters = (ins "ModFlagBehavior":$behavior,
```
I think you can use the enum directly and hopefully it then prints as a string rather than as a number?
https://github.com/llvm/llvm-project/pull/130679
More information about the Mlir-commits
mailing list