1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Go to file
Jakob Stoklund Olesen 40c33bb2b2 Rebuild RegScavenger::DistanceMap each time it is needed.
The register scavenger maintains a DistanceMap that maps MI pointers to their
distance from the top of the current MBB. The DistanceMap is built
incrementally in forward() and in bulk in findFirstUse(). It is used by
scavengeRegister() to determine which candidate register has the longest
unused interval.

Unfortunately the DistanceMap contents can become outdated. The first time
scavengeRegister() is called, the DistanceMap is filled to cover the MBB. If
then instructions are inserted in the MBB (as they always are following
scavengeRegister()), the recorded distances are too short. This causes bad
behaviour in the included test case where a register use /after/ the current
position is ignored because findFirstUse() thinks is is /before/ the current
position. A "using an undefined register" assertion follows promptly.

The fix is to build a fresh DistanceMap at the top of scavengeRegister(), and
discard it after use. This means that DistanceMap is no longer needed as a
RegScavenger member variable, and forward() doesn't need to update it.

The fix then discloses issue number two in the same test case: The candidate
search in scavengeRegister() finds a CSR that has been saved in the prologue,
but is currently unused. It would be both inefficient and wrong to spill such
a register in the emergency spill slot. In the present case, the emergency
slot restore is placed immediately before the normal epilogue restore, leading
to a "Redefining a live register" assertion.

Fix number two: When scavengerRegister() stumbles upon an unused register that
is overwritten later in the MBB, return that register early. It is important
to verify that the register is defined later in the MBB, otherwise it might be
an unspilled CSR.

llvm-svn: 78650
2009-08-11 06:25:12 +00:00
autoconf Lay the groundwork for my upcoming ilist sentinel shrinking patch 2009-08-11 00:59:39 +00:00
bindings Fix comment in llvm.mli. 2009-08-10 19:45:00 +00:00
cmake CMake configuration: find mkdtemp, mkstemp, mktemp. 2009-07-27 18:23:41 +00:00
docs SjLj based exception handling unwinding support. This patch is nasty, brutish 2009-08-11 00:09:57 +00:00
examples Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are 2009-07-31 20:28:14 +00:00
include Rebuild RegScavenger::DistanceMap each time it is needed. 2009-08-11 06:25:12 +00:00
lib Rebuild RegScavenger::DistanceMap each time it is needed. 2009-08-11 06:25:12 +00:00
projects remove dead makefile flags. 2009-06-24 05:29:56 +00:00
runtime Drop toy GC runtime. 2009-03-02 03:46:48 +00:00
test Rebuild RegScavenger::DistanceMap each time it is needed. 2009-08-11 06:25:12 +00:00
tools llvm-mc: Accept .word as a synonym for .short 2009-08-11 04:44:00 +00:00
unittests To catch bugs like the one fixed in 2009-08-07 19:54:29 +00:00
utils Fix a few more places in TableGen that need to handle EVT::vAny types. 2009-08-11 05:03:38 +00:00
website
win32 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come. 2009-07-24 23:12:02 +00:00
Xcode Remove the IA-64 backend. 2009-07-24 00:30:09 +00:00
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt Build Blackfin target with autoconf and cmake. 2009-08-02 17:32:37 +00:00
configure Build Blackfin target with autoconf and cmake. 2009-08-02 17:32:37 +00:00
CREDITS.TXT Vanity. 2009-08-06 21:54:23 +00:00
LICENSE.TXT one fewer license, yay. :) 2009-08-01 22:54:39 +00:00
llvm.spec.in
Makefile Introduce new headers whose inclusion forces linking and 2009-06-16 20:12:29 +00:00
Makefile.common
Makefile.config.in LLVMC can be now compiled w/o dynamic plugin support. 2009-07-04 03:55:25 +00:00
Makefile.rules Add executable suffix for the tool. This is needed e.g. for 'make install' on mingw32. 2009-08-05 09:37:43 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt README.txt: test commit w/blank line appended 2009-03-23 21:00:45 +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 HTML documentation provided in docs/index.html for further
assistance with LLVM.