LLVM backend for 6502
Go to file
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
autoconf Add an autoconf option for turning on -gsplit-dwarf by default 2013-06-25 01:12:25 +00:00
bindings We're in 3.4 land now. 2013-05-07 20:31:28 +00:00
cmake Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake. 2013-06-26 07:57:53 +00:00
docs Add a Subtarget feature 'v8fp' to the ARM backend. 2013-06-27 11:49:26 +00:00
examples ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong to RTDyldMemoryManager. 2013-05-14 23:05:00 +00:00
include Improve the compression of the tablegen DiffLists by introducing a new sort 2013-06-27 19:38:13 +00:00
lib Get rid of the unused class member. 2013-06-27 17:54:10 +00:00
projects Filter out dragonegg when checked out into a projects subdirectory. 2013-06-24 07:21:35 +00:00
runtime Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options. 2013-06-04 15:26:37 +00:00
test Improve the compression of the tablegen DiffLists by introducing a new sort 2013-06-27 19:38:13 +00:00
tools Revert "Debug Info: clean up usage of Verify." as it's breaking bots. 2013-06-26 22:44:57 +00:00
unittests Add a convenience createUniqueDirectory function. 2013-06-27 03:45:31 +00:00
utils Improve the compression of the tablegen DiffLists by introducing a new sort 2013-06-27 19:38:13 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake. 2013-06-26 07:57:53 +00:00
CODE_OWNERS.TXT Add more owners to CODE_OWNERS.TXT (Kostya Serebryany: AddressSanitizer and ThreadSanitizer; Evgeniy Stepanov: MemorySanitizer) 2013-06-27 08:47:12 +00:00
configure Add an autoconf option for turning on -gsplit-dwarf by default 2013-06-25 01:12:25 +00:00
CREDITS.TXT Identify me on IRC. 2013-06-18 22:09:36 +00:00
LICENSE.TXT Be more specific and capitalize filenames. 2013-05-21 21:22:34 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Improved svn repo searching for 'make update' 2013-01-28 03:19:57 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Add an autoconf option for turning on -gsplit-dwarf by default 2013-06-25 01:12:25 +00:00
Makefile.rules Add CXXFLAGS back to the Link command. 2013-06-27 06:09:14 +00:00
README.txt test 2013-04-17 05:34:03 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.