llvm-6502/include/llvm
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
..
ADT [APFloat] Added support for parsing float strings which contain {inf,-inf,NaN,-NaN}. 2013-06-24 09:58:05 +00:00
Analysis Merge isReachable into isBackedge. 2013-06-25 23:32:10 +00:00
Assembly
Bitcode Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00
CodeGen Improve diagnostics when getSizeInBits is called on the Other type. 2013-06-24 17:29:51 +00:00
Config Don't define LTDL_SHLIBPATH_VAR. 2013-06-11 19:04:13 +00:00
DebugInfo llvm-dwarfdump: Add support for dumping the .debug_loc section 2013-06-19 21:37:13 +00:00
ExecutionEngine Pass a StringRef to sys::identifyFileType. 2013-06-10 15:27:39 +00:00
IR Added support for the Builtin attribute. 2013-06-27 00:25:01 +00:00
IRReader
MC Use MCFillFragment for zero-initialized data. 2013-06-27 14:35:03 +00:00
Object [PowerPC] Support @got modifier 2013-06-25 16:49:50 +00:00
Option Merge changes to clang's Driver code into LLVM's Option library 2013-06-13 18:12:12 +00:00
Support [Support/Registry.h] Include llvm/Support/Compiler.h. 2013-06-27 17:57:40 +00:00
TableGen Improve the compression of the tablegen DiffLists by introducing a new sort 2013-06-27 19:38:13 +00:00
Target TableGen: Generate a function for getting operand indices based on their defined names 2013-06-25 21:22:09 +00:00
Transforms Add a flag to defer vectorization into a phase after the inliner and its 2013-06-24 07:21:47 +00:00
AutoUpgrade.h
CMakeLists.txt
DebugInfo.h DebugInfo: enumerator values returned as int64 as they are stored 2013-06-24 07:11:08 +00:00
DIBuilder.h DebugInfo: DIBuilder changes to match DIEnumerator changes in r184694 2013-06-24 17:34:33 +00:00
GVMaterializer.h
InitializePasses.h Remove the simplify-libcalls pass (finally) 2013-06-20 19:48:07 +00:00
InstVisitor.h
LinkAllIR.h
LinkAllPasses.h Remove the simplify-libcalls pass (finally) 2013-06-20 19:48:07 +00:00
Linker.h
Pass.h
PassAnalysisSupport.h
PassManager.h
PassManagers.h
PassRegistry.h
PassSupport.h