llvm-6502/lib
Dale Johannesen 12b882cf53 Fix the time regression I introduced in 464.h264ref with
my last 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.  (This patch does not handle 
all the cases where this can happen.)  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.

Everything above is exercised in
CodeGen/X86/lsr-negative-stride.ll (and ifcvt4 in ARM which is
the same IR).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61178 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 00:57:22 +00:00
..
Analysis Today the front-ends (llvm-gcc and clang) generate multiple llvm.dbg.compile_units to identify source file for various debug entities. Each llvm.dbg.compile_unit matches one file on the disk. However, the backend only supports one DW_TAG_compile_unit per .o file. The backend selects first compile_unit from the vector to construct DW_TAG_compile_unit entry, which is not correct in all cases. 2008-12-17 22:39:29 +00:00
Archive Silence unused variable warnings. 2008-11-21 20:00:59 +00:00
AsmParser Forgot to revert r61031 when I reverted r61019, r61030, and r61040. 2008-12-17 20:59:57 +00:00
Bitcode Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release 2008-12-16 19:06:48 +00:00
CodeGen Revert r61158 for now, as it caused some test failures. 2008-12-17 22:17:27 +00:00
Debugger
ExecutionEngine Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids some overflow issues. Patch by Thomas Jablin. 2008-12-10 02:32:19 +00:00
Linker
Support remove unused var 2008-12-09 17:04:06 +00:00
System Don't use plain %x to print pointer values. I had changed it from %p 2008-12-05 23:39:24 +00:00
Target Add initial support for back-scheduling address computations, 2008-12-16 03:35:01 +00:00
Transforms Fix the time regression I introduced in 464.h264ref with 2008-12-18 00:57:22 +00:00
VMCore This adds some missing functions to the C binding: 2008-12-17 21:39:50 +00:00
Makefile