[llvm] [TableGen] Add `CompressedTupleNameStride` to compress tuple names. (PR #169196)
Jason Eckhardt via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 17:12:34 PST 2025
nvjle wrote:
FWIW: I was curious about the impact on the tuple-heavy AMDGPU target. I applied the feature with this quick experiment:
```
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.td
@@ -71,7 +71,10 @@ class SIRegisterTuples<list<SubRegIndex> Indices, RegisterClass RC,
int last_reg, int stride, int size, string prefix> :
RegisterTuples<Indices,
RegSeqDags<RC, last_reg, stride, size>.ret,
- RegSeqNames<last_reg, stride, size, prefix>.ret>;
+ RegSeqNames<last_reg, stride, size, prefix>.ret> {
+ let CompressedTupleNameStride =
+ !if(!and(!gt(size, 4), !ne(prefix, "ttmp")), 1, 0);
+}
```
That is, compress the names of all tuple classes greater than 4-wide (note: I excluded `TTMP` because there are actually three of those classes-- one defined by `RegisterTuples` and two others that are hand-rolled).
The sizes in bytes are as follows:
```
before after
AMDGPUGenRegisterInfoEnums.inc 1.6M 758K
AMDGPUGenRegisterInfoMCDesc.inc 26M 17M
```
https://github.com/llvm/llvm-project/pull/169196
More information about the llvm-commits
mailing list