LLVM backend for 6502
Go to file
Chris Lattner ad0124c188 Enhance the shift-shift folding code to allow a no-op cast to occur in between
the shifts.

This allows us to fold this (which is the 'integer add a constant' sequence
from cozmic's scheme compmiler):

int %x(uint %anf-temporary776) {
        %anf-temporary777 = shr uint %anf-temporary776, ubyte 1
        %anf-temporary800 = cast uint %anf-temporary777 to int
        %anf-temporary804 = shl int %anf-temporary800, ubyte 1
        %anf-temporary805 = add int %anf-temporary804, -2
        %anf-temporary806 = or int %anf-temporary805, 1
        ret int %anf-temporary806
}

into this:

int %x(uint %anf-temporary776) {
        %anf-temporary776 = cast uint %anf-temporary776 to int
        %anf-temporary776.mask1 = add int %anf-temporary776, -2
        %anf-temporary805 = or int %anf-temporary776.mask1, 1
        ret int %anf-temporary805
}

note that instcombine already knew how to eliminate the AND that the two
shifts fold into.  This is tested by InstCombine/shift.ll:test26

-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25128 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-06 07:52:12 +00:00
autoconf For PR678: 2005-12-22 02:08:30 +00:00
docs Added the spec for the new "extractelement" instruction. 2006-01-05 17:37:02 +00:00
examples
include/llvm Grammer correction. 2006-01-05 01:53:28 +00:00
lib Enhance the shift-shift folding code to allow a no-op cast to occur in between 2006-01-06 07:52:12 +00:00
projects
runtime
test A case that instcombine is not catching. 2006-01-06 07:48:28 +00:00
tools remove unused header 2006-01-05 00:21:37 +00:00
utils Tweak pattern complexity calc. 2006-01-06 02:30:23 +00:00
win32 Teach Visual Studio about new file. 2006-01-04 17:19:48 +00:00
Xcode Adding new files. 2006-01-04 13:37:32 +00:00
.cvsignore
configure Implement fix for PR471: 2005-12-21 03:31:53 +00:00
CREDITS.TXT credit where credit is due 2005-12-22 06:09:08 +00:00
LICENSE.TXT Happy New Year, LLVM. 2006-01-03 14:42:06 +00:00
llvm.spec
llvm.spec.in
Makefile
Makefile.common
Makefile.config.in Implement fix for PR471: 2005-12-21 03:31:53 +00:00
Makefile.rules For PR625: 2005-12-23 22:27:56 +00:00
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.