LLVM backend for 6502
Go to file
Andrew Trick 6ea2b9608a Allocate local registers in order for optimal coloring.
Also avoid locals evicting locals just because they want a cheaper register.

Problem: MI Sched knows exactly how many registers we have and assumes
they can be colored. In cases where we have large blocks, usually from
unrolled loops, greedy coloring fails. This is a source of
"regressions" from the MI Scheduler on x86. I noticed this issue on
x86 where we have long chains of two-address defs in the same live
range. It's easy to see this in matrix multiplication benchmarks like
IRSmk and even the unit test misched-matmul.ll.

A fundamental difference between the LLVM register allocator and
conventional graph coloring is that in our model a live range can't
discover its neighbors, it can only verify its neighbors. That's why
we initially went for greedy coloring and added eviction to deal with
the hard cases. However, for singly defined and two-address live
ranges, we can optimally color without visiting neighbors simply by
processing the live ranges in instruction order.

Other beneficial side effects:

It is much easier to understand and debug regalloc for large blocks
when the live ranges are allocated in order. Yes, global allocation is
still very confusing, but it's nice to be able to comprehend what
happened locally.

Heuristics could be added to bias register assignment based on
instruction locality (think late register pairing, banks...).

Intuituvely this will make some test cases that are on the threshold
of register pressure more stable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:35:14 +00:00
autoconf No ',' between programs. 2013-07-08 21:18:54 +00:00
bindings We're in 3.4 land now. 2013-05-07 20:31:28 +00:00
cmake Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS. 2013-07-17 09:34:51 +00:00
docs Speling. 2013-07-24 20:47:57 +00:00
examples Adding example source to support MCJIT/Kaleidoscope blog posts. 2013-07-22 18:47:24 +00:00
include Add a way to add a kind-value string pair to an attribute. 2013-07-25 18:34:24 +00:00
lib Allocate local registers in order for optimal coloring. 2013-07-25 18:35:14 +00:00
projects The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. 2013-07-01 08:07:52 +00:00
runtime Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options. 2013-06-04 15:26:37 +00:00
test Allocate local registers in order for optimal coloring. 2013-07-25 18:35:14 +00:00
tools Replace the "NoFramePointerElimNonLeaf" target option with a function attribute. 2013-07-25 00:34:29 +00:00
unittests Don't end a file name with a dot. It looks odd. 2013-07-25 15:00:17 +00:00
utils Fix a bug in TableGen where the intrinsic function name recognizer could mis-identify names if one was a prefix substring of the other 2013-07-25 12:32:00 +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 Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS. 2013-07-17 09:34:51 +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 No ',' between programs. 2013-07-08 21:18:54 +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 Fix regular expression used by 'make update' to only look for 'I' and '?' at the start of svn info results and to check for spaces after 'I' instead of just after '?'. 2013-07-03 14:48:37 +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 The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD. 2013-07-01 08:07:52 +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.