[llvm] [Bolt] Add a new hidden option to perf2bolt for testing purpose (PR #163785)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 08:39:30 PST 2025


https://github.com/paschalis-mpeis commented:

Hi Adam,

Thanks for your work! A couple of high-level thoughts after a quick pass:

(1) For the new flag, my thinking was to provide a textual replacement for perf.data:
whatever perf2bolt would invoke, we run it beforehand outselves (ie `perf script ..`) and pass the result to the tool.

Are there actual limitations to using `--perfscript` with basic samples?

Why not call `parseBranchEvents` or `parseBasicEvents`, depending on `BasicAggregation`?
parseBranchEvents would only process the brstack events (ie PerfBranchSample) anyway, right?

(2) The flag is currently a toggle: if set, we treat -p/-perfdata as textual format, right?
We could fully align with llvm-profgen if we want and use -ps/-perfscript as a file instead. Ofc we'll need to adjust the logic, likely in places like [this](https://github.com/llvm/llvm-project/blob/f75973949b0e51eb4b3852c903d08bc72bf5d459/bolt/tools/driver/llvm-bolt.cpp#L255). (not a strong opinion)

@kaadam, @aaupov please let me know of your thoughts.

https://github.com/llvm/llvm-project/pull/163785


More information about the llvm-commits mailing list