[llvm] [TableGen][DecoderEmitter] Add option to emit type-specialized code (PR #146593)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 13:49:08 PDT 2025
s-barannikov wrote:
> > > dispatched to the correct decodeToMCInst* based on the bit width either by making it an argument to decodeInstruction or storing it in the first byte of the table? RISC-V could continue using uint64_t for the decodeInstruction template.
> >
> >
> > This sounds like a good idea to me. (Not sure I understand the "templated decodeInstruction" part.)
>
> Prior to this change decodeInstruction had a template parameter for the type of Insn. I was just suggesting to go back to that.
I see. As an alternative, generate single, non-templated decodeInstruction for the widest integer type (e.g., uint64_t for RISC-V, uint32_t for ARM). This would prevent accidental instantiation of the template for different types.
https://github.com/llvm/llvm-project/pull/146593
More information about the llvm-commits
mailing list