[Mlir-commits] [mlir] [MLIR] Add remark flags to mlir-opt (PR #156825)
Mehdi Amini
llvmlistbot at llvm.org
Wed Sep 10 12:23:45 PDT 2025
================
@@ -204,6 +207,58 @@ struct MlirOptMainConfigCLOptions : public MlirOptMainConfig {
cl::location(generateReproducerFileFlag), cl::init(""),
cl::value_desc("filename"));
+ static cl::OptionCategory remarkCategory(
+ "Remark Options",
+ "Filter remarks by regular expression (llvm::Regex syntax).");
+
+ static llvm::cl::opt<RemarkFormat, /*ExternalStorage=*/true> remarkFormat{
+ "remark-format",
+ llvm::cl::desc("Specify the format for remark output."),
+ cl::location(remarkFormatFlag),
+ llvm::cl::value_desc("format"),
+ llvm::cl::init(REMARK_FORMAT_STDOUT),
+ llvm::cl::values(
+ clEnumValN(REMARK_FORMAT_STDOUT, "emitRemark",
+ "Print as emitRemark to command-line"),
+ clEnumValN(REMARK_FORMAT_YAML, "yaml", "Print yaml file"),
+ clEnumValN(REMARK_FORMAT_BITSTREAM, "bitstream",
+ "Print bitstream file")),
+ llvm::cl::cat(remarkCategory)};
+
+ static cl::opt<std::string, /*ExternalStorage=*/true> remarksAll(
+ "remarks-filter",
+ cl::desc("Show all remarks: passed, missed, failed, analysis"),
+ cl::location(remarksAllFilterFlag), cl::init(""),
+ cl::cat(remarkCategory));
+
+ static cl::opt<std::string, /*ExternalStorage=*/true> remarksFile(
+ "remarks-output-file",
+ cl::desc(
+ "Output file for yaml and bitstream remark formats. Default is "
+ "mlir-remarks.yaml or mlir-remarks.bitstream"),
+ cl::location(remarksOutputFileFlag), cl::init(""),
+ cl::cat(remarkCategory));
+
+ static cl::opt<std::string, /*ExternalStorage=*/true> remarksPassed(
+ "remarks-filter-passed", cl::desc("Show passed remarks"),
----------------
joker-eph wrote:
```suggestion
"remarks-filter-passed", cl::desc("Regex to filter 'passed' remarks, matching the remark category name"),
```
(same for the others)
https://github.com/llvm/llvm-project/pull/156825
More information about the Mlir-commits
mailing list