1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Go to file
Chris Lattner eea864472d Implement simple promotion for cast elimination in instcombine. This is
currently very limited, but can be extended in the future.  For example,
we now compile:

uint %test30(uint %c1) {
        %c2 = cast uint %c1 to ubyte
        %c3 = xor ubyte %c2, 1
        %c4 = cast ubyte %c3 to uint
        ret uint %c4
}

to:

_xor:
        movzbl 4(%esp), %eax
        xorl $1, %eax
        ret

instead of:

_xor:
        movb $1, %al
        xorb 4(%esp), %al
        movzbl %al, %eax
        ret

More impressively, we now compile:

struct B { unsigned bit : 1; };
void xor(struct B *b) { b->bit = b->bit ^ 1; }

To (X86/PPC):

_xor:
        movl 4(%esp), %eax
        xorl $-2147483648, (%eax)
        ret
_xor:
        lwz r2, 0(r3)
        xoris r2, r2, 32768
        stw r2, 0(r3)
        blr

instead of (X86/PPC):

_xor:
        movl 4(%esp), %eax
        movl (%eax), %ecx
        movl %ecx, %edx
        shrl $31, %edx
        # TRUNCATE movb %dl, %dl
        xorb $1, %dl
        movzbl %dl, %edx
        andl $2147483647, %ecx
        shll $31, %edx
        orl %ecx, %edx
        movl %edx, (%eax)
        ret

_xor:
        lwz r2, 0(r3)
        srwi r4, r2, 31
        xori r4, r4, 1
        rlwimi r2, r4, 31, 0, 0
        stw r2, 0(r3)
        blr

This implements InstCombine/cast.ll:test30.

llvm-svn: 28273
2006-05-13 02:06:03 +00:00
autoconf Use the -dumpversion option to llvm-gcc which gives us just the version # 2006-05-09 00:31:01 +00:00
docs Actually, semantical doesn't appear to be a word. 2006-04-26 21:03:17 +00:00
examples Minor corrections. 2006-03-24 03:11:31 +00:00
include/llvm Don't use old-style casts. This prevents compiler warnings when CommandLine.h 2006-05-12 19:20:55 +00:00
lib Implement simple promotion for cast elimination in instcombine. This is 2006-05-13 02:06:03 +00:00
projects Avoid defining dead result 2006-05-12 17:29:40 +00:00
runtime Invert the tests on LLVMGCC_MAJVERS to check for value 4 instead of value 2006-04-07 21:45:23 +00:00
test New testcase for instcombine 2006-05-13 02:00:07 +00:00
tools Remove dead return value. 2006-05-12 17:28:36 +00:00
utils Noop instruction 2006-05-12 07:47:00 +00:00
win32 Keep Visual Studio happy. 2006-05-03 00:28:50 +00:00
Xcode Misc. project changes. html + build config changes supplied by Devang. 2006-04-08 06:04:56 +00:00
.cvsignore Ignore stuff built by "make dist". 2006-04-07 15:55:18 +00:00
configure Use the -dumpversion option to llvm-gcc which gives us just the version # 2006-05-09 00:31:01 +00:00
CREDITS.TXT quick update 2006-04-13 02:05:30 +00:00
LICENSE.TXT Changing domain name 2006-04-20 05:51:53 +00:00
llvm.spec For PR723: 2006-04-07 16:07:37 +00:00
Makefile Include the win32 and Xcode directories in the distribution. 2006-04-12 20:53:14 +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 Fix a comment. 2006-04-09 23:39:43 +00:00
Makefile.rules Fix some problems linking stuff in libTarget. 2006-05-11 03:10:15 +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.