[llvm] [tools][llc] Add `--save-stats` option (PR #163967)
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 22 09:20:52 PDT 2025
MatzeB wrote:
> A generic output like --info-output-file=xxxx.json can mix other streams which are not statistics too, then you'll have to parse it somehow.
Not sure what you are getting at here; there's only timers (`Support/Timer.h`) and statistics (`Support/Statistics.h`) data in there and it's always json when you use the json switch; and in my mind timers and statistics just differ in how they get collected the result is a metric number either way...
> In my [downstream project](https://github.com/dtcxzyw/llvm-opt-benchmark/blob/20437bacf19197e59dafec61dbdc5c7d5aa78e5c/scripts/update.py#L231-L253) I have to do the extra substr to get the JSON body.
When using `--info-output-file=` the whole output is JSON that you could easily parse in python, no?
I'm not convinced the code duplication is that good an idea, so -1 from me. But not gonna block this if people think that `=obj` logic to deduce the statistics filename from the output filename is all that valuable...
https://github.com/llvm/llvm-project/pull/163967
More information about the llvm-commits
mailing list