llvm-6502/test/MC
Chad Rosier b7110cf5b5 Improve the compression of the tablegen DiffLists by introducing a new sort
algorithm when assigning EnumValues to the synthesized registers.

The current algorithm, LessRecord, uses the StringRef compare_numeric
function.  This function compares strings, while handling embedded numbers.
For example, the R600 backend registers are sorted as follows:

  T1
  T1_W
  T1_X
  T1_XYZW
  T1_Y
  T1_Z
  T2
  T2_W
  T2_X
  T2_XYZW
  T2_Y
  T2_Z

In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2
have an EnumValue offset of 6 from one another.  However, in other parts
of the register bank, the scaling factors are different:

dEnum/dN = 5:
  KC0_128_W
  KC0_128_X
  KC0_128_XYZW
  KC0_128_Y
  KC0_128_Z
  KC0_129_W
  KC0_129_X
  KC0_129_XYZW
  KC0_129_Y
  KC0_129_Z

The diff lists do not work correctly because different kinds of registers have
different 'scaling factors'.  This new algorithm, LessRecordRegister, tries to
enforce a scaling factor of 1.  For example, the registers are now sorted as
follows:

  T1
  T2
  T3
  ...
  T0_W
  T1_W
  T2_W
  ...
  T0_X
  T1_X
  T2_X
  ...
  KC0_128_W
  KC0_129_W
  KC0_130_W
  ...

For the Mips and R600 I see a 19% and 6% reduction in size, respectively.  I
did see a few small regressions, but the differences were on the order of a
few bytes (e.g., AArch64 was 16 bytes).  I suspect there will be even
greater wins for targets with larger register files.

Patch reviewed by Jakob.
rdar://14006013


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185094 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 19:38:13 +00:00
..
AArch64 AArch64: fix overzealous NEXTing for Windows testing. 2013-06-23 15:32:01 +00:00
ARM Improve the compression of the tablegen DiffLists by introducing a new sort 2013-06-27 19:38:13 +00:00
AsmParser Fix a bug in the MC asm parser evaluating expressions. It was treating: 2013-05-07 21:40:58 +00:00
COFF [mc-coff] Forward Linker Option flags into the .drectve section 2013-04-25 19:34:41 +00:00
Disassembler [Mips Disassembler] Have the DecodeCCRRegisterClass function use the getReg 2013-06-26 22:23:32 +00:00
ELF [MC/DWARF] Generate multiple .debug_line entries for adjacent .loc directives 2013-06-19 21:27:27 +00:00
MachO Revert r15266. This fixes llvm.org/pr15266. 2013-02-14 16:23:08 +00:00
Markup
MBlaze
Mips [mips] Do not emit ".option pic0" if target is mips64. 2013-06-26 19:08:49 +00:00
PowerPC [PowerPC] Accept 17-bit signed immediates for addis 2013-06-26 13:49:53 +00:00
SystemZ [SystemZ] Immediate compare-and-branch support 2013-05-29 11:58:52 +00:00
X86 Add support for encoding the HLE XACQUIRE and XRELEASE prefixes. 2013-06-18 17:08:10 +00:00