circt icon indicating copy to clipboard operation
circt copied to clipboard

[firtool] -verbose-pass-executions prints wrong options for drop-names

Open dtzSiFive opened this issue 2 years ago • 1 comments

Specifying various -preserve-values= options (default is 'none' presently) does change the option but not as expected:

$ ./bin/firtool ./test.fir -verbose-pass-executions -preserve-values=none |& grep -o "drop-names{preserve-values=[^}]\+}"
drop-names{preserve-values=named}
drop-names{preserve-values=named}
drop-names{preserve-values=named}
drop-names{preserve-values=named}

none is default, and is reported as 'named' (shown above). Here's what's printed for each of the supported values:

"none" → "named" "named" → "none" "all" → "none"

AFAICT the options are working properly, just printed/reported incorrectly.

dtzSiFive avatar Jul 12 '22 17:07 dtzSiFive

Thanks, I'll take a look. The printer simply relies on printAsTextualPipeline method so it might be a MLIR problem.

https://github.com/llvm/circt/blob/f6f2492e3c582eb9d6505724e2c25f25f1154add/tools/firtool/firtool.cpp#L375

uenoku avatar Jul 12 '22 18:07 uenoku

This works now after latest LLVM bump!

Checked after seeing related upstream fix for cl::opt equality: https://github.com/llvm/llvm-project/pull/65754 :tada: .

Woohoo!

dtzSiFive avatar Sep 13 '23 13:09 dtzSiFive