[llvm] [TableGen][DecoderEmitter] Add option to emit type-specialized `decodeToMCInst` (PR #146593)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 16:55:49 PDT 2025


jurahul wrote:

> > > > > > @topperc My question is still unanswered. WDYT of this new interface to op-in into this optimization?
> > > > > 
> > > > > 
> > > > > Interface seems fine. Do you plan to opt-in all targets or just the ones that benefit?
> > > > 
> > > > 
> > > > Thanks. Maybe all targets? If nothing else, they probably benefit from compile time improvements due to non-templated code.
> > > 
> > > 
> > > It's not many functions and not many callers per file right? If there's a big compile time cost for templates, `fieldFromInstruction` feels like it would be a bigger issue than `decodeToMCInst`.
> > 
> > 
> > Right, I am not sure what exactly might contribute to the compile time cost. But you're right, if we want we can specialize fieldFromInstruction as well once we have the types. May be in a follow-on PR.
> 
> Have you been able to measure a compile time cost or is this hypothetical?

Hypothetical at this point. But the original benefits of ~20% reduction in size still applies (without going to the largest type requires).

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


More information about the llvm-commits mailing list