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 PR2731: C and Ocaml bindings for setTailCall and isTailCall. 2008-08-30 16:34:54 +00:00
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 Add "sample" documentation to sample project. 2008-09-15 05:31:29 +00:00
runtime Fixing the stack walker. 2008-01-24 05:16:36 +00:00
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 Remove Stacker.html from Xcode project. 2008-10-14 23:23:59 +00:00
build-for-llvm-top.sh
CMakeLists.txt CMake: Option for building with -fPIC. 2008-11-20 19:13:51 +00:00
configure Add XCore backend. 2008-11-07 10:59:00 +00:00
CREDITS.TXT Keep CREDITS.TXT sorted by name. 2008-11-07 12:44:36 +00:00
LICENSE.TXT llvmc doesn't exist anymore, and llvmc2 doesn't have a special license file. 2008-06-20 20:05:57 +00:00
llvm.spec.in
Makefile Proper way of doing llvm canadian-cross compilation. 2008-11-10 07:33:13 +00:00
Makefile.common remove attributions from the rest of the llvm makefiles. 2007-12-29 20:11:13 +00:00
Makefile.config.in Use spaces rather than tab. 2008-10-22 09:42:14 +00:00
Makefile.rules Fix PR3117: not all nodes being legalized. The 2008-12-09 21:33:20 +00:00
ModuleInfo.txt
README.txt Remove extra lines 2008-07-28 20:50:25 +00:00

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.