llvm-6502/include/llvm/Analysis
Chris Lattner 9e59c64c14 Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which 
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:

BB1:
   X = load P
   br BB3
BB2:
   Y = load Q
   br BB3
BB3:
   R = phi [P] [Q]
   load R

turning "load R" into a phi of X/Y.  In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more 
efficient.  For example, consider:


bb1:  // has many predecessors.
   P = some_operator()
   load P

In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P.  In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something.  In many other cases though, it would scan and not
find anything useful.  MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors.  This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful.  For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!.  IMO, scalar GVN 
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.

In the future, this should be enhanced to phi translate through geps and 
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 03:35:32 +00:00
..
AliasAnalysis.h Update comments. There is no getArgumentAccesses. 2008-12-05 05:35:21 +00:00
AliasSetTracker.h Fold the useful features of alist and alist_node into ilist, and 2008-07-28 21:51:04 +00:00
CallGraph.h Teach internalize to preserve the callgraph. 2008-10-03 07:36:09 +00:00
CFGPrinter.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ConstantFolding.h "ret (constexpr)" can't be folded into a Constant. Add a method to 2008-05-25 20:56:15 +00:00
ConstantsScanner.h For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h" 2008-05-29 17:41:17 +00:00
DebugInfo.h Fix getFieldAs() to use the parameter instead of 6. 2008-12-13 08:25:29 +00:00
DominatorInternals.h Fix more -Wshorten-64-to-32 warnings. 2008-05-05 18:30:58 +00:00
Dominators.h Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
EscapeAnalysis.h Trim #includes. 2008-10-16 20:18:31 +00:00
FindUsedTypes.h Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
Interval.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
IntervalIterator.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
IntervalPartition.h Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
LibCallAliasAnalysis.h Expose a public interface to this pass. 2008-06-05 23:45:18 +00:00
LibCallSemantics.h Revert 51775. 2008-05-30 22:47:19 +00:00
LoopInfo.h Use empty() instead of begin() == end(). 2008-08-14 18:13:49 +00:00
LoopPass.h Fix typo. 2008-11-26 18:13:11 +00:00
LoopVR.h Because of the laziness, the required passes must exist even after 2008-06-30 01:04:39 +00:00
MemoryDependenceAnalysis.h Implement initial support for PHI translation in memdep. This means that 2008-12-15 03:35:32 +00:00
Passes.h Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away. 2008-08-15 21:31:02 +00:00
PostDominators.h Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
ProfileInfo.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ProfileInfoLoader.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ProfileInfoTypes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ScalarEvolution.h Add a new SCEV representing signed division. 2008-12-02 08:05:48 +00:00
ScalarEvolutionExpander.h Add a new SCEV representing signed division. 2008-12-02 08:05:48 +00:00
ScalarEvolutionExpressions.h Add a new SCEV representing signed division. 2008-12-02 08:05:48 +00:00
SparsePropagation.h "This patch adds a virtual call to AbstractLatticeFunction to derive a 2008-08-09 17:23:35 +00:00
Trace.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ValueTracking.h - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag. 2008-06-30 07:31:25 +00:00
Verifier.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00