llvm-6502/include/llvm
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
..
ADT add a new insertAfter method, patch by Tom Jablin! 2009-01-13 07:43:51 +00:00
Analysis Fix the time regression I introduced in 464.h264ref with 2009-01-14 02:35:31 +00:00
Assembly Reimplement the old and horrible bison parser for .ll files with a nice 2009-01-02 07:01:27 +00:00
Bitcode Add support for writing LLVM IR to a specified BitstreamWriter. 2008-12-19 18:37:59 +00:00
CodeGen Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info. 2009-01-13 23:54:55 +00:00
CompilerDriver Add a --check-graph option to llvmc. 2009-01-09 16:16:27 +00:00
Config Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
Debugger Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
ExecutionEngine Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
Support Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator). 2009-01-14 00:38:21 +00:00
System Update the stub and callback code to handle lazy compilation. The stub 2008-10-20 21:39:23 +00:00
Target Use DebugInfo interface to lower dbg_* intrinsics. 2009-01-13 00:35:13 +00:00
Transforms Adjustments to last patch based on review. 2009-01-09 01:30:11 +00:00
AbstractTypeUser.h implement simplify_type for PATypeHolder so that isa<FooType>(PATypeHolder) 2008-12-27 07:47:40 +00:00
Argument.h Don't analyze arguments already marked 'nocapture'. 2008-12-31 18:08:59 +00:00
Attributes.h Add a new Attribute::getAlignmentFromAttrs method. 2008-12-31 08:41:38 +00:00
AutoUpgrade.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
BasicBlock.h fix grammar, thanks Duncan! 2008-12-11 11:44:49 +00:00
CallGraphSCCPass.h Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
CallingConv.h Add "inreg" field to CallSDNode (doesn't increase 2008-09-26 19:31:26 +00:00
CMakeLists.txt CMake: Adds header and TableGen files to Visual Studio solution. A new 2008-11-15 02:08:08 +00:00
Constant.h fix typo's 2008-10-13 10:28:12 +00:00
Constants.h Reword the comment for ConstantInt's getLimitedValue. 2008-12-20 17:06:39 +00:00
DerivedTypes.h Assert that VectorType::getTruncatedElementVectorType is not used with 2009-01-07 23:44:27 +00:00
Function.h Add utility functions for marking parameters as noalias or nocapture. 2009-01-04 18:21:35 +00:00
GlobalAlias.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
GlobalValue.h Rename isWeakForLinker to mayBeOverridden. Use it 2008-09-29 11:25:42 +00:00
GlobalVariable.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
InlineAsm.h Keep track of *which* input constraint matches an output 2008-10-17 16:47:46 +00:00
InstrTypes.h Use the opcode predicates, instead of duplicating the code. 2008-10-17 21:42:45 +00:00
Instruction.def Cosmetic. 2008-10-06 20:33:02 +00:00
Instruction.h add a new insertAfter method, patch by Tom Jablin! 2009-01-13 07:43:51 +00:00
Instructions.h add a helper method. 2009-01-09 05:27:40 +00:00
IntrinsicInst.h reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an 2008-11-21 16:42:48 +00:00
Intrinsics.h Large mechanical patch. 2008-09-25 21:00:45 +00:00
Intrinsics.td add nocapture attribute to llvm.mem* intrinsics and have tblgen 2009-01-12 01:12:03 +00:00
IntrinsicsAlpha.td Modify the intrinsics pattern to separate out the "return" types from the 2008-11-13 09:08:33 +00:00
IntrinsicsARM.td Modify the intrinsics pattern to separate out the "return" types from the 2008-11-13 09:08:33 +00:00
IntrinsicsCellSPU.td Modify the intrinsics pattern to separate out the "return" types from the 2008-11-13 09:08:33 +00:00
IntrinsicsPowerPC.td Modify the intrinsics pattern to separate out the "return" types from the 2008-11-13 09:08:33 +00:00
IntrinsicsX86.td Modify the intrinsics pattern to separate out the "return" types from the 2008-11-13 09:08:33 +00:00
IntrinsicsXCore.td Add XCore intrinsics for getid (returns thread id) and bitrev (reverses 2008-11-14 10:12:16 +00:00
LinkAllPasses.h Rename AddReadAttrs to FunctionAttrs, and teach it how 2008-12-31 16:14:43 +00:00
LinkAllVMCore.h opt was not exporting the Mangler symbols 2008-11-05 22:42:50 +00:00
Linker.h * Alphabetized system headers per the style guide 2009-01-02 20:26:30 +00:00
Module.h Add a mechanism to specify attributes in getOrInsertFunction. 2009-01-04 22:54:40 +00:00
ModuleProvider.h Remove warnings about unused parameters and shadowed variables. 2008-05-19 20:15:12 +00:00
OperandTraits.h 80col 2008-07-05 22:41:37 +00:00
Pass.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
PassAnalysisSupport.h Speed up the passmgr by avoiding heap thrashing on vectors. 2008-08-08 05:33:04 +00:00
PassManager.h allow updating the MPM, so that you can use one FunctionPAssManager with 2008-06-26 22:26:45 +00:00
PassManagers.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
PassSupport.h Correct a comment. 2008-06-24 17:46:48 +00:00
SymbolTableListTraits.h Fold the useful features of alist and alist_node into ilist, and 2008-07-28 21:51:04 +00:00
Type.h add a new form of Type::dump that takes a module for type names, 2008-10-01 20:16:19 +00:00
TypeSymbolTable.h Tidy up #includes, deleting a bunch of unnecessary #includes. 2009-01-05 17:59:02 +00:00
Use.h eliminate tabs from my previous commit 2009-01-05 16:28:14 +00:00
User.h Do not allow a user to set the operand for a constant. 2008-10-28 17:22:40 +00:00
Value.h Comment typeo fix, thanks Duncan! 2008-12-02 18:33:11 +00:00
ValueSymbolTable.h implement some fixme's by making "autorenaming" in the value symbol table not 2008-06-27 21:26:26 +00:00