LLVM backend for 6502
Go to file
Lang Hames d54d4f6b2e New PBQP solver, and updates to the PBQP graph.
The previous PBQP solver was very robust but consumed a lot of memory,
performed a lot of redundant computation, and contained some unnecessarily tight
coupling that prevented experimentation with novel solution techniques. This new
solver is an attempt to address these shortcomings.

Important/interesting changes:

1) The domain-independent PBQP solver class, HeuristicSolverImpl, is gone.
It is replaced by a register allocation specific solver, PBQP::RegAlloc::Solver
(see RegAllocSolver.h).

The optimal reduction rules and the backpropagation algorithm have been extracted
into stand-alone functions (see ReductionRules.h), which can be used to build
domain specific PBQP solvers. This provides many more opportunities for
domain-specific knowledge to inform the PBQP solvers' decisions. In theory this
should allow us to generate better solutions. In practice, we can at least test
out ideas now.

As a side benefit, I believe the new solver is more readable than the old one.

2) The solver type is now a template parameter of the PBQP graph.

This allows the graph to notify the solver of any modifications made (e.g. by
domain independent rules) without the overhead of a virtual call. It also allows
the solver to supply policy information to the graph (see below).

3) Significantly reduced memory overhead.

Memory management policy is now an explicit property of the PBQP graph (via
the CostAllocator typedef on the graph's solver template argument). Because PBQP
graphs for register allocation tend to contain many redundant instances of
single values (E.g. the value representing an interference constraint between
GPRs), the new RASolver class uses a uniquing scheme. This massively reduces
memory consumption for large register allocation problems. For example, looking
at the largest interference graph in each of the SPEC2006 benchmarks (the
largest graph will always set the memory consumption high-water mark for PBQP),
the average memory reduction for the PBQP costs was 400x. That's times, not
percent. The highest was 1400x. Yikes. So - this is fixed.

"PBQP: No longer feasting upon every last byte of your RAM".

Minor details:

- Fully C++11'd. Never copy-construct another vector/matrix!

- Cute tricks with cost metadata: Metadata that is derived solely from cost
matrices/vectors is attached directly to the cost instances themselves. That way
if you unique the costs you never have to recompute the metadata. 400x less
memory means 400x less cost metadata (re)computation.

Special thanks to Arnaud de Grandmaison, who has been the source of much
encouragement, and of many very useful test cases.

This new solver forms the basis for future work, of which there's plenty to do.
I will be adding TODO notes shortly.

- Lang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202551 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 22:25:24 +00:00
autoconf [C++11] Switch autoconf and make to use C++11 by default. Now both build 2014-02-28 21:47:41 +00:00
bindings [python-bindings] Remove some cruft that snuck in. 2014-02-23 04:43:26 +00:00
cmake With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00
docs [docs] Clarify that there isn't much to be done other than watch build 2014-02-28 21:59:51 +00:00
examples Use DataLayout from the module when easily available. 2014-02-25 23:25:17 +00:00
include New PBQP solver, and updates to the PBQP graph. 2014-02-28 22:25:24 +00:00
lib New PBQP solver, and updates to the PBQP graph. 2014-02-28 22:25:24 +00:00
projects Drop libtool from llvm. 2014-02-28 18:17:54 +00:00
test R600/SI: Expand all v16[if]32 operations 2014-02-28 21:36:37 +00:00
tools Centralize the handling of install_name and rpath. 2014-02-28 13:48:03 +00:00
unittests With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00
utils Add an OutPatFrag TableGen class 2014-02-28 00:26:56 +00:00
.arcconfig
.clang-format
.gitignore Added .DS_Store entry in .gitignore for ignoring .DS_Store files in the source 2014-01-25 15:15:16 +00:00
CMakeLists.txt [C++11] Switch CMake to use C++11 by default! Next up, autoconf/make! 2014-02-28 21:30:03 +00:00
CODE_OWNERS.TXT Add myself as owner for libc++ 2014-02-18 14:03:17 +00:00
configure [C++11] Switch autoconf and make to use C++11 by default. Now both build 2014-02-28 21:47:41 +00:00
CREDITS.TXT
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
llvm.spec.in
LLVMBuild.txt
Makefile Provide CMake package modules in install tree 2014-02-09 16:37:02 +00:00
Makefile.common
Makefile.config.in With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00
Makefile.rules Centralize the handling of install_name and rpath. 2014-02-28 13:48:03 +00:00
README.txt

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.