[llvm] [LLVM][TableGen] Parameterize NumToSkip in DecoderEmitter (PR #136456)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 16:04:20 PDT 2025


jurahul wrote:

> > Note: this is failing for our downstream toolchain due to a hard-coded field, specfically due to '178' being used, whereas our downstream target ends up with '179'.
> > ```
> > llvm-project/llvm/test/TableGen/VarLenDecoder.td:59:22: error: CHECK-LARGE-NEXT: expected string not found in input
> > // CHECK-LARGE-NEXT: /* 8 */ MCD::OPC_Decode, 178, 2, 0, // Opcode: FOO16
> >                      ^
> > <stdin>:78:1: note: possible intended match here
> > /* 8 */ MCD::OPC_Decode, 179, 2, 0, // Opcode: FOO16
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > Is it necessary to hard code the values? I observe other checks in these tests use regular expressions to avoid having to deal with hard-coded fields and opcodes.
> 
> I agree this is fragile. This value is going to change anytime a new `StandardPseudoInstruction` is added to `Target.td` or a new GISel instruction is added to `GenericOpcodes.td`

I didn't realize that the test used a RE instead of hard-coded values in the earlier form. Will fix the new test to use the same.

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


More information about the llvm-commits mailing list