[Mlir-commits] [mlir] [MLIR][LLVM] More on CG Profile: support null function entries (PR #137269)
Tobias Gysi
llvmlistbot at llvm.org
Thu Apr 24 22:37:33 PDT 2025
================
@@ -1370,10 +1370,17 @@ def ModuleFlagCGProfileEntryAttr
]>]
```
}];
- let parameters = (ins "FlatSymbolRefAttr":$from,
- "FlatSymbolRefAttr":$to,
- "uint64_t":$count);
- let assemblyFormat = "`<` struct(params) `>`";
+ let parameters = (
+ ins OptionalParameter<"std::optional<FlatSymbolRefAttr>">:$from,
+ OptionalParameter<"std::optional<FlatSymbolRefAttr>">:$to,
----------------
gysit wrote:
Wouldn't using OptionalParameter<"FlatSymbolRefAttr"> on its own be enough? For attributes, the nullptr can be used as optional value and AFAIK the printer and parser by default will just omit the nullptr values. That way the custom parser and printer should not be necessary except you want to print the null value explicitly.
https://github.com/llvm/llvm-project/pull/137269
More information about the Mlir-commits
mailing list