[llvm] [MCA] Enable customization of individual instructions (PR #155420)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 09:15:13 PDT 2025


mshockwave wrote:

> We cant just keep the strings and do the parsing in the callbacks called from InstrBuilder, but that looks too expensive for me (especially in case MCA is used as a library and latency already comes in numeric form from some external source, so no parsing is required).

I was indeed thinking about re-parsing every time, but you have a point here and I agree, so maybe we can restore to one of your previous approaches which create a new class derived from `Instrument` (it was called `CustomInstrument` IIRC, but we can have some more specific name like `LatencyInstrument`). That being said, I still don't think we should have the `Instrument::customize` and `Instrument::canCustomize` -- I believe we can conditionally static_cast to this new LatencyInstrument by the getDesc it returns.

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


More information about the llvm-commits mailing list