For PR1319:

Upgrade tests to work with new llvm.exp version of llvm_runtest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-04-14 20:13:02 +00:00
parent 3a693b7933
commit 2b544beda3
116 changed files with 199 additions and 171 deletions

View File

@ -1,7 +1,7 @@
; This testcase is incorrectly getting completely eliminated. There should be
; SOME instruction named %c here, even if it's a bitwise and.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep '%c'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep %c
;
ulong %test3(ulong %A) {
%c1 = cast ulong %A to ubyte

View File

@ -1,6 +1,7 @@
; This testcase can be simplified by "realizing" that alloca can never return
; null.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | llvm-dis | not grep 'br '
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | \
; RUN: llvm-dis | not grep br
implementation ; Functions:

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i1 false'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {ret i1 false}
bool %test(bool %V) {
%Y = setlt bool %V, false
ret bool %Y

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | not grep 'int 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | \
; RUN: not grep {int 1}
; When propagating the load through the select, make sure that the load is
; inserted where the original load was, not where the select is. Not doing

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg -simplifycfg | llvm-dis | \
; RUN: grep -v store | not grep 'int 1'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg -simplifycfg | \
; RUN: llvm-dis | grep -v store | not grep {int 1}
; Test to make sure that instcombine does not accidentally propagate the load
; into the PHI, which would break the program.

View File

@ -9,7 +9,8 @@
; be eliminated. In many cases the setCC is also eliminated based on the
; constant value and the range of the casted value.
;
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast '.*int'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: notcast .*int
implementation ; Functions:

View File

@ -1,4 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'ret bool false'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {ret bool false}
bool %test(ulong %tmp.169) {
%tmp.1710 = shr ulong %tmp.169, ubyte 1
%tmp.1912 = setgt ulong %tmp.1710, 0

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'ret i1 true'
; RUN: grep {ret i1 true}
; PR586
%g_07918478 = external global uint ; <uint*> [#uses=1]

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep undef
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep undef
int %test(sbyte %A) {
%B = cast sbyte %A to int

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep shl &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep shl
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast
; This cannot be turned into a sign extending cast!

View File

@ -1,5 +1,6 @@
; The optimizer should be able to remove cast operation here.
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | not grep 'sext.*i32'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep sext.*i32
bool %eq_signed_to_small_unsigned(sbyte %SB) {
%Y = cast sbyte %SB to uint ; <uint> [#uses=1]

View File

@ -1,6 +1,7 @@
; This test case is reduced from llvmAsmParser.cpp
; The optimizer should not remove the cast here.
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'sext.*i32'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep sext.*i32
bool %test(short %X) {
%A = cast short %X to uint

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'and'
; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep and
ulong %foo(ulong %tmp, ulong %tmp2) {
%tmp = cast ulong %tmp to uint
%tmp2 = cast ulong %tmp2 to uint

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep mul | wc -l | grep 2
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep mul | wc -l | grep 2
<4 x float> %test(<4 x float> %V) {

View File

@ -1,4 +1,5 @@
;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis |not grep memmove.i32
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep memmove.i32
; Instcombine was trying to turn this into a memmove.i32
target datalayout = "e-p:64:64"

View File

@ -1,5 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'and.*32' &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'or.*153'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep and.*32
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep or.*153
; PR1014
int %test(int %tmp1) {

View File

@ -1,4 +1,4 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep sub &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep sub
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep add
<4 x float> %test(<4 x float> %tmp26, <4 x float> %tmp53) {

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep '%bothcond ='
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {%bothcond =}
bool %Doit_bb(int %i.0) {
bb: ; preds = %newFuncRoot
%tmp = setgt int %i.0, 0 ; <bool> [#uses=1]

View File

@ -1,4 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis|grep 'icmp sgt'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {icmp sgt}
; END.
; ModuleID = 'visible.bc'
target datalayout = "e-p:32:32"
target endian = little

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep select
; END.
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32

View File

@ -1,5 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v 'icmp ult int'
; RUN: grep -v {icmp ult int}
; END.
; ModuleID = 'good.bc'
target datalayout = "e-p:32:32"
target endian = little

View File

@ -1,8 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'icmp' | wc -l | grep 1
; RUN: grep icmp | wc -l | grep 1
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'icmp ugt' | wc -l | grep 1
;
; RUN: grep {icmp ugt} | wc -l | grep 1
; END.
; ModuleID = 'bugpoint-tooptimize.bc'
target datalayout = "e-p:32:32"
target endian = little

View File

@ -1,6 +1,7 @@
; For PR1065. This causes an assertion in instcombine if a select with two cmp
; operands is encountered.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
; END.
; ModuleID = 'PR1065.bc'
target datalayout = "e-p:32:32"
target endian = little

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'fcmp uno.*0.0'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {fcmp uno.*0.0}
; PR1111
define i1 @test(double %X) {
%tmp = fcmp une double %X, %X

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep "ugt.*, 1"
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ugt.*, 1}
define i1 @test(i32 %tmp1030) {
%tmp1037 = icmp ne i32 %tmp1030, 40 ; <i1> [#uses=1]

View File

@ -1,5 +1,7 @@
; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep '%A = alloca' &&
; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep '%B = alloca'
; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep {%A = alloca}
; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \
; RUN: not grep {%B = alloca}
; END.
; Ensure that instcombine doesn't sink the loads in entry/cond_true into
; cond_next. Doing so prevents mem2reg from promoting the B alloca.

View File

@ -1,11 +1,9 @@
;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine |llvm-dis |grep zext
;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep zext
;Make sure the uint isn't removed.
;instcombine in llvm 1.9 was dropping the uint cast which was causing a sign
;extend
;this only affected code with pointers in the high half of memory, so it wasn't
;noticed much :)
;compile a kernel though...
; Make sure the uint isn't removed. Instcombine in llvm 1.9 was dropping the
; uint cast which was causing a sign extend. This only affected code with
; pointers in the high half of memory, so it wasn't noticed much
; compile a kernel though...
target datalayout = "e-p:32:32"
target endian = little

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp sle'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp sle}
; PR1244
define i1 @test(i32 %c.3.i, i32 %d.292.2.i) {

View File

@ -1,5 +1,5 @@
; For PR1248
; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep 'ugt i32 .*, 11'
; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep {ugt i32 .*, 11}
define i1 @test(i32 %tmp6) {
%tmp7 = sdiv i32 %tmp6, 12 ; <i32> [#uses=1]
icmp ne i32 %tmp7, -6 ; <i1>:1 [#uses=1]

View File

@ -1,6 +1,6 @@
; PR1271
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep 'icmp eq i32 .tmp.*, 2146435072'
; RUN: grep {icmp eq i32 .tmp.*, 2146435072}
%struct..0anon = type { i32, i32 }
%struct..1anon = type { double }

View File

@ -1,6 +1,7 @@
; PR1271
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep 'ashr i32 %.mp137, 2'
; RUN: grep {ashr i32 %.mp137, 2}
; END.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
target triple = "i686-pc-linux-gnu"

View File

@ -4,7 +4,7 @@
; is not done. It should be removed when code gen supports "funny"
; bit widths.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'add i49.*-8388608'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i49.*-8388608}
define i49 @test5(i49 %x) {
;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext.

View File

@ -1,4 +1,5 @@
; RUN: llvm-as < %s | opt -instcombine -disable-output
; END.
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
target triple = "i686-apple-darwin8"

View File

@ -3,7 +3,7 @@
; 64-bit targets.
;
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep '= add '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= add }
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
target triple = "x86_64-unknown-freebsd6.2"

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep select | not grep 'int\*'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep select | not grep {i32\\*}
; This testcase corresponds to PR362, which notices that this horrible code
; is generated by the C++ front-end and LLVM optimizers, which has lots of

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -gcse -instcombine | llvm-dis | not grep getelementptr
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -gcse -instcombine | \
; RUN: llvm-dis | not grep getelementptr
bool %test(int* %A) {
%B = getelementptr int* %A, int 1

View File

@ -1,7 +1,8 @@
; This is the sequence of stuff that the Java front-end expands for a single
; <= comparison. Check to make sure we turn it into a <= (only)
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp sle'| not grep '#uses'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v {icmp sle} | not grep #uses
bool %le(int %A, int %B) {
%c1 = setgt int %A, %B;

View File

@ -1,6 +1,8 @@
; Zero byte allocas should be deleted.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep alloca
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep alloca
; END.
declare void %use(...)
void %test() {

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep and | wc -l | grep 1
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep and | wc -l | grep 1
; Should be optimized to one and.
bool %test1(uint %a, uint %b) {

View File

@ -9,7 +9,8 @@
;
; Which corresponds to test1.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'or '
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {or }
int %test1(int %X, int %Y) {
%A = and int %X, 7

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1 &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2
; (x&z) ^ (y&z) -> (x^y)&z

View File

@ -1,7 +1,6 @@
; This test makes sure that add instructions are properly eliminated.
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add

View File

@ -1,7 +1,6 @@
; This test makes sure that add instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add

View File

@ -11,7 +11,7 @@
;
; This tests arbitrary precision integers.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'or '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {or }
define i17 @test1(i17 %X, i17 %Y) {
%A = and i17 %X, 7

View File

@ -1,7 +1,7 @@
; This test case checks that the merge of and/xor can work on arbitrary
; precision integers.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1 &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2
; (x &z ) ^ (y & z) -> (x ^ y) & z

View File

@ -1,8 +1,7 @@
; This test makes sure that and instructions are properly eliminated.
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'and '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
define i39 @test0(i39 %A) {
%B = and i39 %A, 0 ; zero result

View File

@ -1,8 +1,7 @@
; This test makes sure that and instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'and '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {and }
define i999 @test0(i999 %A) {

View File

@ -1,5 +1,4 @@
; Tests to make sure elimination of casts is working correctly
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
define i17 @test1(i17 %a) {

View File

@ -1,9 +1,8 @@
; Test that elimination of logical operators works with
; arbitrary precision integers.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: not grep '(and\|xor\|add\|shl\|shr)'
; RUN: not grep {(and\|xor\|add\|shl\|shr)}
; END.
define i33 @test1(i33 %x) {
%tmp.1 = and i33 %x, 65535 ; <i33> [#uses=1]

View File

@ -1,8 +1,6 @@
; This test makes sure that or instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
;
; RUN: llvm-as < %s | opt -instcombine | llvm-dis > /tmp/or2.rel &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep or

View File

@ -1,7 +1,6 @@
; This test makes sure that these instructions are properly eliminated.
; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
;
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem

View File

@ -1,7 +1,6 @@
; This test makes sure that these instructions are properly eliminated.
; This test is for Integer BitWidth >= 64 && BitWidth <= 1024.
;
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep rem

View File

@ -1,7 +1,6 @@
; This test makes sure that these instructions are properly eliminated.
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select &&
; RUN: llvm-as < %s | opt -instcombine -disable-output
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select
define i41 @test1(i1 %C) {

View File

@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: egrep 'shl|lshr|ashr' | wc -l | grep 3
; RUN: egrep {shl|lshr|ashr} | wc -l | grep 3
define i41 @test0(i41 %A, i41 %B, i41 %C) {
%X = shl i41 %A, %C

View File

@ -1,8 +1,7 @@
; This test makes sure that shit instructions are properly eliminated
; even with arbitrary precision integers.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sh
; END.
define i47 @test1(i47 %A) {
%B = shl i47 %A, 0 ; <i47> [#uses=1]

View File

@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis > /tmp/sht.rel &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl
; END.
define i1 @test0(i39 %X, i39 %A) {
%B = lshr i39 %X, %A

View File

@ -2,8 +2,8 @@
; even with arbitrary precision integers.
;
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v 'sub i19 %Cok, %Bok' | not grep sub
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v {sub i19 %Cok, %Bok} | not grep sub
define i23 @test1(i23 %A) {
%B = sub i23 %A, %A ; <i23> [#uses=1]

View File

@ -1,8 +1,7 @@
; This test makes sure that xor instructions are properly eliminated.
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'xor '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
define i47 @test1(i47 %A, i47 %B) {

View File

@ -1,8 +1,7 @@
; This test makes sure that xor instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'xor '
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {xor }
define i447 @test1(i447 %A, i447 %B) {

View File

@ -1,7 +1,6 @@
; Tests to make sure elimination of casts is working correctly
; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast '' '%c1.*'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*}
define i47 @test_sext_zext(i11 %A) {
%c1 = zext i11 %A to i39

View File

@ -1,7 +1,6 @@
; Tests to make sure elimination of casts is working correctly
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast '' '%c1.*'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast {} {%c1.*}
define i1024 @test_sext_zext(i77 %A) {
%c1 = zext i77 %A to i533

View File

@ -1,7 +1,7 @@
; This file contains various testcases that require tracking whether bits are
; set or cleared by various instructions.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -instcombine | llvm-dis | not grep %ELIM
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -instcombine | llvm-dis |\
; RUN: not grep %ELIM
; Reduce down to a single XOR
int %test3(int %B) {

View File

@ -1,6 +1,7 @@
; Tests to make sure bit counts of constants are folded
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'ret i32 19' &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v declare | not grep 'llvm.ct'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 19}
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: grep -v declare | not grep llvm.ct
declare i32 @llvm.ctpop.i31(i31 %val)
declare i32 @llvm.cttz.i32(i32 %val)

View File

@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | llvm-dis | not grep 'call void %abort'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | llvm-dis |\
; RUN: not grep {call void %abort}
%b_rec.0 = external global int

View File

@ -1,5 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep ret | wc -l | grep 3 &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'call.*bswap'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep ret | wc -l | grep 3
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep call.*bswap
bool %test1(ushort %tmp2) {
%tmp10 = call ushort %llvm.bswap.i16( ushort %tmp2 )

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'call.*llvm.bswap' | wc -l | grep 5
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {call.*llvm.bswap} | wc -l | grep 5
uint %test1(uint %i) {
%tmp1 = shr uint %i, ubyte 24 ; <uint> [#uses=1]

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep call | not grep bitcast
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep call | not grep bitcast
target endian = little
target pointersize = 32

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep call | notcast
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep call | notcast
implementation

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'setne\|setle\|setge'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {setne\|setle\|setge}
int %test1(uint %X, uint %Y) {
%C = setne uint %X, %Y

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep bitcast
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep bitcast
bool %test1(uint %val) {
%t1 = bitcast uint %val to int

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ubyte
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep ubyte
int %test1(uint %X) {
%Y = cast uint %X to ubyte ;; Turn into an AND

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -globaldce | llvm-dis | not grep Array
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -globaldce | llvm-dis | \
; RUN: not grep Array
; Pulling the cast out of the load allows us to eliminate the load, and then
; the whole array.

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | not grep load
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | \
; RUN: not grep load
int %test1(uint* %P) {
%A = alloca uint

View File

@ -1,6 +1,6 @@
; Tests to make sure elimination of casts is working correctly
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep '%c' | notcast
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep %c | notcast
%inbuf = external global [32832 x ubyte]

View File

@ -1,5 +1,4 @@
; Tests to make sure elimination of casts is working correctly
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast
define i16 @test1(i16 %a) {

View File

@ -1,5 +1,4 @@
; Tests to make sure elimination of casts is working correctly
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast
; XFAIL: *

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i32 %A'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {ret i32 %A}
int %test(int %A) {
%X = or bool false, false

View File

@ -1,3 +1,3 @@
load_lib llvm-dg.exp
load_lib llvm.exp
llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep getelementptr
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep getelementptr
bool %test1(short* %P, int %I, int %J) {
%X = getelementptr short* %P, int %I

View File

@ -1,6 +1,7 @@
; The %A getelementptr instruction should be eliminated here
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v '%B' | not grep getelementptr &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v %B | not grep getelementptr
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep foo1
%Global = constant [10 x sbyte] c"helloworld"

View File

@ -1,4 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast '' 'getelementptr.*'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: notcast {} {getelementptr.*}
%G = external global [3 x sbyte]
implementation

View File

@ -1,5 +1,6 @@
; Test folding of constantexpr geps into normal geps.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -gcse -instcombine | llvm-dis | not grep getelementptr
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -gcse -instcombine | \
; RUN: llvm-dis | not grep getelementptr
%Array = external global [40 x int]

View File

@ -1,4 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | %prcontext div 1 | grep then:
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: %prcontext div 1 | grep then:
;; This tests that the div is hoisted into the then block.

View File

@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp
; END.
define i32 @test1(i32 %X) {
entry:

View File

@ -1,7 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep load
; END.
%X = constant int 42
%X2 = constant int 47

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'ret i32 0' &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0}
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc
; PR1201
define i32 @main(i32 %argc, i8** %argv) {
@ -9,4 +9,3 @@ define i32 @main(i32 %argc, i8** %argv) {
free i8* %tmp_207
ret i32 0
}

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'ret i32 0' &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 0}
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc
; PR1313

View File

@ -1,7 +1,7 @@
; This test makes sure that memmove instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'call void %llvm.memmove'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {call void @llvm.memmove}
%S = internal constant [33 x sbyte] c"panic: restorelist inconsistency\00"

View File

@ -1,6 +1,5 @@
; This test makes sure that mul instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep mul
implementation

View File

@ -1,8 +1,7 @@
; This file contains various testcases that check to see that instcombine
; is narrowing computations when possible.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'ret i1 false'
; RUN: grep {ret i1 false}
; test1 - Eliminating the casts in this testcase (by narrowing the AND
; operation) allows instcombine to realize the function always returns false.

View File

@ -1,8 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v xor | not grep 'or '
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v xor | not grep {or }
implementation

View File

@ -1,5 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ' or'
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep { or}
define i32 @test1(i32 %b, i32 %c, i32 %d) {
%tmp3 = and i32 %c, %b

View File

@ -1,7 +1,5 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep phi
implementation

View File

@ -1,6 +1,5 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep rem
implementation

View File

@ -1,7 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep select &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep select
implementation

View File

@ -1,7 +1,7 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep icmp
; END.
%X = uninitialized global int

View File

@ -1,7 +1,10 @@
; This test case was reduced from MultiSource/Applications/hbd. It makes sure
; that folding doesn't happen in case a zext is applied where a sext should have
; been when a setcc is used with two casts.
; RUN: llvm-upgrade < %s | llvm-as | llc -instcombine | llvm-dis | not grep 'br bool false'
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: not grep {br bool false}
; END.
int %bug(ubyte %inbuff) {
entry:
%tmp = bitcast ubyte %inbuff to sbyte ; <sbyte> [#uses=1]

View File

@ -2,8 +2,9 @@
; working. Basically this boils down to converting setlt,gt,le,ge instructions
; into equivalent setne,eq instructions.
;
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp eq' | grep -v 'icmp ne' | not grep icmp
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep -v {icmp eq} | grep -v {icmp ne} | not grep icmp
; END.
bool %test1(uint %A) {
%B = setge uint %A, 1 ; setne %A, 0

View File

@ -1,5 +1,5 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: egrep 'shl|lshr|ashr' | wc -l | grep 3
; RUN: egrep {shl|lshr|ashr} | wc -l | grep 3
define i32 @test0(i32 %A, i32 %B, i32 %C) {
%X = shl i32 %A, %C

View File

@ -1,6 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep 'lshr i32' | wc -l | grep 2 &&
; RUN: grep {lshr i32} | wc -l | grep 2
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ashr
int %test1(int %X, ubyte %A) {

Some files were not shown because too many files have changed in this diff Show More