llvm/lib/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
..
IPA reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an 2008-11-21 16:42:48 +00:00
AliasAnalysis.cpp
AliasAnalysisCounter.cpp
AliasAnalysisEvaluator.cpp
AliasDebugger.cpp
AliasSetTracker.cpp
Analysis.cpp
BasicAliasAnalysis.cpp Allow basicaa to walk through geps with identical indices in 2008-12-10 01:04:47 +00:00
CFGPrinter.cpp Rationalize the names of passes that print information: 2008-09-23 12:47:39 +00:00
CMakeLists.txt add new file 2008-11-10 02:58:28 +00:00
ConstantFolding.cpp Fix whitespace in comment. 2008-12-15 01:35:36 +00:00
DebugInfo.cpp Fix getFieldAs() to use the parameter instead of 6. 2008-12-13 08:25:29 +00:00
EscapeAnalysis.cpp Trim #includes. 2008-10-16 20:18:31 +00:00
InstCount.cpp
Interval.cpp
IntervalPartition.cpp
LibCallAliasAnalysis.cpp
LibCallSemantics.cpp
LoopInfo.cpp
LoopPass.cpp
LoopVR.cpp Avoid crashing if instruction is not part of a loop. 2008-10-27 10:18:45 +00:00
Makefile
MemoryDependenceAnalysis.cpp Implement initial support for PHI translation in memdep. This means that 2008-12-15 03:35:32 +00:00
PostDominators.cpp
ProfileInfo.cpp
ProfileInfoLoader.cpp
ProfileInfoLoaderPass.cpp
ScalarEvolution.cpp Revert my re-instated reverted commit, fixes the bootstrap build on x86-64 linux. 2008-12-12 17:09:07 +00:00
ScalarEvolutionExpander.cpp Add a new SCEV representing signed division. 2008-12-02 08:05:48 +00:00
SparsePropagation.cpp
Trace.cpp
ValueTracking.cpp Re-apply 55137 with fixes. 2008-10-27 23:24:03 +00:00