[llvm] [TabeGen] Add `PreferSmallerInstructions` for Targets. (PR #83587)

Alfie Richards via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 01:53:59 PST 2024


AlfieRichardsArm wrote:

@s-barannikov Regarding 
> I think this check should be tie-breaking rather than defining, and so it should be moved below, after we've compared the number of operands and their classes.
> Also, does this check supersede the AVX/AVX512 resolution below?

It is my understanding this needs to be here for ARM. The architecture reference manual states: 
```
If neither .W nor .N is specified, the assembler can select either a 16-bit or 32-bit encoding. If both encoding
lengths are available, it must select a 16-bit encoding.
```
There are cases (such as thumb 1 instructions with a CCOut operand whereas thumb 2 doesnt) where the smaller instruction has more operands, so choosing that first would make this non-compliant. 

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


More information about the llvm-commits mailing list