Old fork of llvm-mirror, used on older RPCS3 builds
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 When a function takes a variable number of pointer arguments, with a zero 2005-10-23 04:37:20 +00:00
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 unbreak the build again 2005-10-27 16:30:44 +00:00
runtime Add the remove() function from the C library. 2005-11-28 15:49:15 +00:00
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 Ignore the configure.out file generated by "make reconfigure" 2005-06-18 23:01:25 +00:00
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 Onward to LLVM-1.6 and beyond! 2005-05-18 20:23:20 +00:00
llvm.spec.in Onward to LLVM-1.6 and beyond! 2005-05-18 20:23:20 +00:00
Makefile For PR614: 2005-08-25 04:59:49 +00:00
Makefile.common Update comments to reflect new variable names. Patch contributed by 2005-02-14 16:02:19 +00:00
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 Make the text of this file a little more useful. 2004-09-02 22:49:27 +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.