LLVM backend for 6502
Go to file
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
autoconf Revert accidental last patch 2008-11-20 04:28:08 +00:00
bindings
cmake Fix a link issue I ran into trying compiling LLVM on MinGW with CMake. 2008-11-30 02:42:05 +00:00
docs Introducing nocapture, a parameter attribute for pointers to indicate that the 2008-12-15 01:34:58 +00:00
examples reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an 2008-11-21 16:42:48 +00:00
include Implement initial support for PHI translation in memdep. This means that 2008-12-15 03:35:32 +00:00
lib Implement initial support for PHI translation in memdep. This means that 2008-12-15 03:35:32 +00:00
projects
runtime
test Implement initial support for PHI translation in memdep. This means that 2008-12-15 03:35:32 +00:00
tools Add a comment to the auto-generated docs. 2008-12-13 17:51:47 +00:00
utils Put Edge* classes into anonymous namespace. 2008-12-11 10:34:18 +00:00
website
win32 Add files to VC++ projects. 2008-11-13 21:18:54 +00:00
Xcode
build-for-llvm-top.sh
CMakeLists.txt CMake: Option for building with -fPIC. 2008-11-20 19:13:51 +00:00
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
Makefile
Makefile.common
Makefile.config.in
Makefile.rules Fix PR3117: not all nodes being legalized. The 2008-12-09 21:33:20 +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.