LLVM backend for 6502
Go to file
Chris Lattner c739cd6d07 my recent change caused a failure in a bswap testcase, because it changed
the order that instcombine processed instructions in the testcase.  The end
result is that instcombine finished with:

define i16 @test1(i16 %a) {
        %tmp = zext i16 %a to i32               ; <i32> [#uses=2]
        %tmp21 = lshr i32 %tmp, 8               ; <i32> [#uses=1]
        %tmp5 = shl i32 %tmp, 8         ; <i32> [#uses=1]
        %tmp.upgrd.32 = or i32 %tmp21, %tmp5            ; <i32> [#uses=1]
        %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16           ; <i16> [#uses=1]
        ret i16 %tmp.upgrd.3
}

which can't get matched as a bswap.

This patch makes instcombine more sophisticated about removing truncating
casts, allowing it to turn this into:

define i16 @test2(i16 %a) {
        %tmp211 = lshr i16 %a, 8
        %tmp52 = shl i16 %a, 8
        %tmp.upgrd.323 = or i16 %tmp211, %tmp52
        ret i16 %tmp.upgrd.323
}

which then matches as bswap.  This fixes bswap.ll and implements
InstCombine/cast2.ll:test[12].  This also implements cast elimination of
add/sub.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 05:27:34 +00:00
autoconf Add possibility to set memory limit for binaries run via libSystem. This 2007-02-16 19:11:07 +00:00
docs grammaro 2007-03-02 02:57:34 +00:00
examples eliminate vector-related ctors 2007-02-13 06:06:26 +00:00
include Add isPositive for symmetry with isNegative. 2007-03-03 00:24:39 +00:00
lib my recent change caused a failure in a bswap testcase, because it changed 2007-03-03 05:27:34 +00:00
projects avoid collision with /usr/bin/sample if this ever gets installed. 2007-02-18 03:03:41 +00:00
runtime crtend is only for llvm-gcc3, remove it. 2007-02-23 19:34:09 +00:00
test new testcase: instcombine should remove all the casts. 2007-03-03 05:24:06 +00:00
tools Make output for ConstantInt construction correct for any bitwidth. 2007-03-01 20:55:43 +00:00
utils rename some CCActions 2007-02-28 05:29:06 +00:00
win32 Unbreak VC++ build. 2007-01-15 20:27:18 +00:00
Xcode Update project 2007-01-29 18:45:08 +00:00
.cvsignore Add llvm.spec, a generated file. 2006-10-18 19:23:56 +00:00
configure Regenerate for getrlimit/setrlimit. 2007-02-16 19:17:20 +00:00
CREDITS.TXT Added myself 2007-02-27 10:44:42 +00:00
LICENSE.TXT remove these. 2007-02-25 02:28:21 +00:00
llvm.spec.in Minor technical correction in documentation. 2006-08-21 01:58:57 +00:00
Makefile revert r1.68. This breaks 'make install' without doing 'make' first, but 2007-02-21 06:23:20 +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 For PR739: 2007-01-17 20:24:45 +00:00
Makefile.rules correct dependency 2007-02-28 05:10:40 +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.