LLVM backend for 6502
Go to file
Dale Johannesen 2f46bb8178 Fix the time regression I introduced in 464.h264ref with
my earlier patch to this file.

The issue there was that all uses of an IV inside a loop
are actually references to Base[IV*2], and there was one
use outside that was the same but LSR didn't see the base
or the scaling because it didn't recurse into uses outside
the loop; thus, it used base+IV*scale mode inside the loop
instead of pulling base out of the loop.  This was extra bad
because register pressure later forced both base and IV into
memory.  Doing that recursion, at least enough
to figure out addressing modes, is a good idea in general;
the change in AddUsersIfInteresting does this.  However,
there were side effects....

It is also possible for recursing outside the loop to
introduce another IV where there was only 1 before (if
the refs inside are not scaled and the ref outside is).
I don't think this is a common case, but it's in the testsuite.
It is right to be very aggressive about getting rid of
such introduced IVs (CheckForIVReuse and the handling of
nonzero RewriteFactor in StrengthReduceStridedIVUsers).
In the testcase in question the new IV produced this way
has both a nonconstant stride and a nonzero base, neither
of which was handled before.  And when inserting 
new code that feeds into a PHI, it's right to put such 
code at the original location rather than in the PHI's 
immediate predecessor(s) when the original location is outside 
the loop (a case that couldn't happen before)
(RewriteInstructionToUseNewBase); better to avoid making
multiple copies of it in this case.

Also, the mechanism for keeping SCEV's corresponding to GEP's
no longer works, as the GEP might change after its SCEV
is remembered, invalidating the SCEV, and we might get a bad
SCEV value when looking up the GEP again for a later loop.  
This also couldn't happen before, as we weren't recursing
into GEP's outside the loop.

Also, when we build an expression that involves a (possibly
non-affine) IV from a different loop as well as an IV from
the one we're interested in (containsAddRecFromDifferentLoop),
don't recurse into that.  We can't do much with it and will
get in trouble if we try to create new non-affine IVs or something.

More testcases are coming.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-14 02:35:31 +00:00
autoconf Modify the unittests Makefiles so that they don't rebuild parts of LLVM just to 2009-01-04 23:12:21 +00:00
bindings Rename getABITypeSize to getTypePaddedSize, as 2009-01-12 20:38:59 +00:00
cmake CMake: replace `rm' with portable invocations of cmake. 2009-01-07 19:24:44 +00:00
docs Document several current CodeGen limitations in LangRef.html. 2009-01-12 23:12:39 +00:00
examples reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an 2008-11-21 16:42:48 +00:00
include Fix the time regression I introduced in 464.h264ref with 2009-01-14 02:35:31 +00:00
lib Fix the time regression I introduced in 464.h264ref with 2009-01-14 02:35:31 +00:00
projects
runtime
test Fix the time regression I introduced in 464.h264ref with 2009-01-14 02:35:31 +00:00
tools Make -o a prefix option. 2009-01-14 02:02:16 +00:00
unittests Fix naming of file. 2009-01-11 01:25:51 +00:00
utils Rename getABITypeSize to getTypePaddedSize, as 2009-01-12 20:38:59 +00:00
website
win32 Rename AddReadAttrs to FunctionAttrs, and teach it how 2008-12-31 16:14:43 +00:00
Xcode Remove Stacker.html from Xcode project. 2008-10-14 23:23:59 +00:00
build-for-llvm-top.sh
CMakeLists.txt CMake: Option for building with -fPIC. 2008-11-20 19:13:51 +00:00
configure Regenerate. 2009-01-04 23:12:30 +00:00
CREDITS.TXT * Moved author attribution to CREDITS.TXT 2009-01-08 16:40:25 +00:00
LICENSE.TXT Renamed Google Test license file from COPYING to LICENSE.TXT to match LLVM 2009-01-05 17:42:15 +00:00
llvm.spec.in
Makefile Removed trailing whitespace. 2009-01-08 02:11:55 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.rules Support llvmc plugins in out-of-tree projects. 2009-01-09 16:31:01 +00:00
ModuleInfo.txt
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 HTML documentation provided in docs/index.html for further
assistance with LLVM.