llvm.org GIT mirror llvm / 53a66d1
Remove llvm-upgrade and update tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47296 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 12 years ago
162 changed file(s) with 3185 addition(s) and 3385 deletion(s). Raw diff Collapse all Expand all
0 ; There should be exactly two calls here (memset and malloc), no more.
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jsr | count 2
1 ; RUN: llvm-as < %s | llc -march=alpha | grep jsr | count 2
22
33 %typedef.bc_struct = type opaque
4 declare void @llvm.memset.i64(i8*, i8, i64, i32)
45
5 implementation ; Functions:
6 define i1 @l12_l94_bc_divide_endif_2E_3_2E_ce(i32* %tmp.71.reload, i32 %scale2.1.3, i32 %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, i32* %tmp.92.reload, i32 %tmp.94.reload, i32* %tmp.98.reload, i32 %tmp.100.reload, i8** %tmp.112.out, i32* %tmp.157.out, i8** %tmp.158.out) {
7 newFuncRoot:
8 %tmp.120 = add i32 %extra.0, 2 ; [#uses=1]
9 %tmp.122 = add i32 %tmp.120, %tmp.94.reload ; [#uses=1]
10 %tmp.123 = add i32 %tmp.122, %tmp.100.reload ; [#uses=2]
11 %tmp.112 = malloc i8, i32 %tmp.123 ; [#uses=1]
12 %tmp.137 = zext i32 %tmp.123 to i64 ; [#uses=1]
13 tail call void @llvm.memset.i64( i8* %tmp.112, i8 0, i64 %tmp.137, i32 0 )
14 ret i1 true
15 }
616
7 declare void %llvm.memset.i64(sbyte*, ubyte, ulong, uint)
8
9 bool %l12_l94_bc_divide_endif_2E_3_2E_ce(int* %tmp.71.reload, uint %scale2.1.3, uint %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, int* %tmp.92.reload, uint %tmp.94.reload, int* %tmp.98.reload, uint %tmp.100.reload, sbyte** %tmp.112.out, uint* %tmp.157.out, sbyte** %tmp.158.out) {
10 newFuncRoot:
11 %tmp.120 = add uint %extra.0, 2 ; [#uses=1]
12 %tmp.122 = add uint %tmp.120, %tmp.94.reload ; [#uses=1]
13 %tmp.123 = add uint %tmp.122, %tmp.100.reload ; [#uses=2]
14 %tmp.112 = malloc sbyte, uint %tmp.123 ; [#uses=3]
15 %tmp.137 = cast uint %tmp.123 to ulong ; [#uses=1]
16 tail call void %llvm.memset.i64( sbyte* %tmp.112, ubyte 0, ulong %tmp.137, uint 0 )
17 ret bool true
18 }
0 ; This shouldn't crash
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
1 ; RUN: llvm-as < %s | llc -march=alpha
22
3 ; ModuleID = 'bugpoint-reduced-simplified.bc'
4 target endian = little
5 target pointersize = 64
6 %.str_4 = external global [44 x sbyte] ; <[44 x sbyte]*> [#uses=0]
3 @.str_4 = external global [44 x i8] ; <[44 x i8]*> [#uses=0]
74
8 implementation ; Functions:
5 declare void @printf(i32, ...)
96
10 declare void %printf(int, ...)
7 define void @main() {
8 entry:
9 %tmp.11861 = icmp slt i64 0, 1 ; [#uses=1]
10 %tmp.19466 = icmp slt i64 0, 1 ; [#uses=1]
11 %tmp.21571 = icmp slt i64 0, 1 ; [#uses=1]
12 %tmp.36796 = icmp slt i64 0, 1 ; [#uses=1]
13 br i1 %tmp.11861, label %loopexit.2, label %no_exit.2
1114
12 void %main() {
13 entry:
14 %tmp.11861 = setlt long 0, 1 ; [#uses=1]
15 %tmp.19466 = setlt long 0, 1 ; [#uses=1]
16 %tmp.21571 = setlt long 0, 1 ; [#uses=1]
17 %tmp.36796 = setlt long 0, 1 ; [#uses=1]
18 br bool %tmp.11861, label %loopexit.2, label %no_exit.2
15 no_exit.2: ; preds = %entry
16 ret void
1917
20 no_exit.2: ; preds = %entry
21 ret void
18 loopexit.2: ; preds = %entry
19 br i1 %tmp.19466, label %loopexit.3, label %no_exit.3.preheader
2220
23 loopexit.2: ; preds = %entry
24 br bool %tmp.19466, label %loopexit.3, label %no_exit.3.preheader
21 no_exit.3.preheader: ; preds = %loopexit.2
22 ret void
2523
26 no_exit.3.preheader: ; preds = %loopexit.2
27 ret void
24 loopexit.3: ; preds = %loopexit.2
25 br i1 %tmp.21571, label %no_exit.6, label %no_exit.4
2826
29 loopexit.3: ; preds = %loopexit.2
30 br bool %tmp.21571, label %no_exit.6, label %no_exit.4
27 no_exit.4: ; preds = %loopexit.3
28 ret void
3129
32 no_exit.4: ; preds = %loopexit.3
33 ret void
30 no_exit.6: ; preds = %no_exit.6, %loopexit.3
31 %tmp.30793 = icmp sgt i64 0, 0 ; [#uses=1]
32 br i1 %tmp.30793, label %loopexit.6, label %no_exit.6
3433
35 no_exit.6: ; preds = %no_exit.6, %loopexit.3
36 %tmp.30793 = setgt long 0, 0 ; [#uses=1]
37 br bool %tmp.30793, label %loopexit.6, label %no_exit.6
34 loopexit.6: ; preds = %no_exit.6
35 %Z.1 = select i1 %tmp.36796, double 1.000000e+00, double 0x3FEFFF7CEDE74EAE; [#uses=2]
36 tail call void (i32, ...)* @printf( i32 0, i64 0, i64 0, i64 0, double 1.000000e+00, double 1.000000e+00, double %Z.1, double %Z.1 )
37 ret void
38 }
3839
39 loopexit.6: ; preds = %no_exit.6
40 %Z.1 = select bool %tmp.36796, double 1.000000e+00, double 0x3FEFFF7CEDE74EAE ; [#uses=2]
41 tail call void (int, ...)* %printf( int 0, long 0, long 0, long 0, double 1.000000e+00, double 1.000000e+00, double %Z.1, double %Z.1 )
42 ret void
43 }
0 ; The global symbol should be legalized
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
1 ; RUN: llvm-as < %s | llc -march=alpha
22
3 target endian = little
4 target pointersize = 64
5 %struct.LIST_HELP = type { %struct.LIST_HELP*, sbyte* }
6 %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, long, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [44 x sbyte] }
7 %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, int }
8 %clause_SORT = external global [21 x %struct.LIST_HELP*] ; <[21 x %struct.LIST_HELP*]*> [#uses=1]
9 %ia_in = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
10 %multvec_j = external global [100 x uint] ; <[100 x uint]*> [#uses=1]
3 target datalayout = "e-p:64:64"
4 %struct.LIST_HELP = type { %struct.LIST_HELP*, i8* }
5 %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
6 %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
7 @clause_SORT = external global [21 x %struct.LIST_HELP*] ; <[21 x %struct.LIST_HELP*]*> [#uses=0]
8 @ia_in = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
9 @multvec_j = external global [100 x i32] ; <[100 x i32]*> [#uses=0]
1110
12 implementation ; Functions:
11 define void @main(i32 %argc) {
12 clock_Init.exit:
13 %tmp.5.i575 = load i32* null ; [#uses=1]
14 %tmp.309 = icmp eq i32 %tmp.5.i575, 0 ; [#uses=1]
15 br i1 %tmp.309, label %UnifiedReturnBlock, label %then.17
1316
14 void %main(int %argc) {
15 clock_Init.exit:
16 %tmp.5.i575 = load int* null ; [#uses=1]
17 %tmp.309 = seteq int %tmp.5.i575, 0 ; [#uses=1]
18 br bool %tmp.309, label %UnifiedReturnBlock, label %then.17
17 then.17: ; preds = %clock_Init.exit
18 store %struct._IO_FILE* null, %struct._IO_FILE** @ia_in
19 %savedstack = call i8* @llvm.stacksave( ) ; [#uses=0]
20 ret void
1921
20 then.17: ; preds = %clock_Init.exit
21 store %struct._IO_FILE* null, %struct._IO_FILE** %ia_in
22 %savedstack = call sbyte* %llvm.stacksave( ) ; [#uses=0]
23 ret void
24
25 UnifiedReturnBlock: ; preds = %clock_Init.exit
26 ret void
22 UnifiedReturnBlock: ; preds = %clock_Init.exit
23 ret void
2724 }
2825
29 declare sbyte* %llvm.stacksave()
26 declare i8* @llvm.stacksave()
0 ; This shouldn't crash
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
1 ; RUN: llvm-as < %s | llc -march=alpha
22
3 ; ModuleID = 'simp.bc'
4 target endian = little
5 target pointersize = 64
3 target datalayout = "e-p:64:64"
64 target triple = "alphaev6-unknown-linux-gnu"
75 deplibs = [ "c", "crtend", "stdc++" ]
8 %struct.__va_list_tag = type { sbyte*, int }
6 %struct.__va_list_tag = type { i8*, i32 }
97
10 implementation ; Functions:
8 define i32 @emit_library_call_value(i32 %nargs, ...) {
9 entry:
10 %tmp.223 = va_arg %struct.__va_list_tag* null, i32 ; [#uses=1]
11 ret i32 %tmp.223
12 }
1113
12 uint %emit_library_call_value(int %nargs, ...) {
13 entry:
14 %tmp.223 = va_arg %struct.__va_list_tag* null, uint ; [#uses=0]
15 ret uint %tmp.223
16 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
0 ; RUN: llvm-as < %s | llc -march=alpha
11
2 target endian = little
3 target pointersize = 64
2 target datalayout = "e-p:64:64"
43 target triple = "alphaev67-unknown-linux-gnu"
5 %llvm.dbg.compile_unit.type = type { uint, { }*, uint, uint, sbyte*, sbyte*, sbyte* }
6 %struct._Callback_list = type { %struct._Callback_list*, void (uint, %struct.ios_base*, int)*, int, int }
7 %struct._Impl = type { int, %struct.facet**, ulong, %struct.facet**, sbyte** }
8 %struct._Words = type { sbyte*, long }
9 "struct.__codecvt_abstract_base" = type { %struct.facet }
10 "struct.basic_streambuf >" = type { int (...)**, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct.locale }
11 %struct.facet = type { int (...)**, int }
12 %struct.ios_base = type { int (...)**, long, long, uint, uint, uint, %struct._Callback_list*, %struct._Words, [8 x %struct._Words], int, %struct._Words*, %struct.locale }
13 %struct.locale = type { %struct._Impl* }
14 "struct.ostreambuf_iterator >" = type { "struct.basic_streambuf >"*, bool }
15 %llvm.dbg.compile_unit1047 = external global %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
4 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i32, i8*, i8*, i8* }
5 %struct._Callback_list = type { %struct._Callback_list*, void (i32, %struct.ios_base*, i32)*, i32, i32 }
6 %struct._Impl = type { i32, %struct.facet**, i64, %struct.facet**, i8** }
7 %struct._Words = type { i8*, i64 }
8 %"struct.__codecvt_abstract_base" = type { %struct.facet }
9 %"struct.basic_streambuf >" = type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %struct.locale }
10 %struct.facet = type { i32 (...)**, i32 }
11 %struct.ios_base = type { i32 (...)**, i64, i64, i32, i32, i32, %struct._Callback_list*, %struct._Words, [8 x %struct._Words], i32, %struct._Words*, %struct.locale }
12 %struct.locale = type { %struct._Impl* }
13 %"struct.ostreambuf_iterator >" = type { %"struct.basic_streambuf >"*, i1 }
14 @llvm.dbg.compile_unit1047 = external global %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1]
1615
17 implementation ; Functions:
16 define void @_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_() {
17 entry:
18 %tmp234 = icmp eq i8 0, 0 ; [#uses=1]
19 br i1 %tmp234, label %cond_next243, label %cond_true235
1820
19 void %_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_() {
20 entry:
21 %tmp234 = seteq sbyte 0, 0 ; [#uses=1]
22 br bool %tmp234, label %cond_next243, label %cond_true235
21 cond_true235: ; preds = %entry
22 ret void
2323
24 cond_true235: ; preds = %entry
25 ret void
26
27 cond_next243: ; preds = %entry
28 %tmp428 = load long* null ; [#uses=1]
29 %tmp428 = cast long %tmp428 to uint ; [#uses=1]
30 %tmp429 = alloca sbyte, uint %tmp428 ; [#uses=0]
31 call void %llvm.dbg.stoppoint( uint 1146, uint 0, { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit1047 to { }*) )
32 unreachable
24 cond_next243: ; preds = %entry
25 %tmp428 = load i64* null ; [#uses=1]
26 %tmp428.upgrd.1 = trunc i64 %tmp428 to i32 ; [#uses=1]
27 %tmp429 = alloca i8, i32 %tmp428.upgrd.1 ; [#uses=0]
28 call void @llvm.dbg.stoppoint( i32 1146, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit1047 to { }*) )
29 unreachable
3330 }
3431
35 declare void %llvm.dbg.stoppoint(uint, uint, { }*)
32 declare void @llvm.dbg.stoppoint(i32, i32, { }*)
33
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
0 ; RUN: llvm-as < %s | llc -march=alpha
11
2 target endian = little
3 target pointersize = 64
2 target datalayout = "e-p:64:64"
43 target triple = "alphaev67-unknown-linux-gnu"
54
6 implementation ; Functions:
7
8 int %_ZN9__gnu_cxx18__exchange_and_addEPVii(int* %__mem, int %__val) {
5 define i32 @_ZN9__gnu_cxx18__exchange_and_addEPVii(i32* %__mem, i32 %__val) {
96 entry:
10 %__tmp = alloca int, align 4 ; [#uses=1]
11 %tmp3 = call int asm sideeffect "\0A$$Lxadd_0:\0A\09ldl_l $0,$3\0A\09addl $0,$4,$1\0A\09stl_c $1,$2\0A\09beq $1,$$Lxadd_0\0A\09mb", "=&r,=*&r,=*m,m,r"( int* %__tmp, int* %__mem, int* %__mem, int %__val ) ; [#uses=1]
12 ret int %tmp3
7 %__tmp = alloca i32, align 4 ; [#uses=1]
8 %tmp3 = call i32 asm sideeffect "\0A$$Lxadd_0:\0A\09ldl_l $0,$3\0A\09addl $0,$4,$1\0A\09stl_c $1,$2\0A\09beq $1,$$Lxadd_0\0A\09mb", "=&r,=*&r,=*m,m,r"( i32* %__tmp, i32* %__mem, i32* %__mem, i32 %__val ) ; [#uses=1]
9 ret i32 %tmp3
1310 }
1411
15 void %_ZN9__gnu_cxx12__atomic_addEPVii(int* %__mem, int %__val) {
12 define void @_ZN9__gnu_cxx12__atomic_addEPVii(i32* %__mem, i32 %__val) {
1613 entry:
17 %tmp2 = call int asm sideeffect "\0A$$Ladd_1:\0A\09ldl_l $0,$2\0A\09addl $0,$3,$0\0A\09stl_c $0,$1\0A\09beq $0,$$Ladd_1\0A\09mb", "=&r,=*m,m,r"( int* %__mem, int* %__mem, int %__val ) ; > [#uses=0]
14 %tmp2 = call i32 asm sideeffect "\0A$$Ladd_1:\0A\09ldl_l $0,$2\0A\09addl $0,$3,$0\0A\09stl_c $0,$1\0A\09beq $0,$$Ladd_1\0A\09mb", "=&r,=*m,m,r"( i32* %__mem, i32* %__mem, i32 %__val ) ; > [#uses=0]
1815 ret void
1916 }
17
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
0 ; RUN: llvm-as < %s | llc -march=alpha
11
22 target datalayout = "e-p:64:64"
3 target endian = little
4 target pointersize = 64
53 target triple = "alphaev67-unknown-linux-gnu"
6 %struct.va_list = type { sbyte*, int, int }
4 %struct.va_list = type { i8*, i32, i32 }
75
8 implementation ; Functions:
9
10 void %yyerror(int, ...) {
6 define void @yyerror(i32, ...) {
117 entry:
12 call void %llvm.va_start( %struct.va_list* null )
8 %va.upgrd.1 = bitcast %struct.va_list* null to i8* ; [#uses=1]
9 call void @llvm.va_start( i8* %va.upgrd.1 )
1310 ret void
1411 }
1512
16 declare void %llvm.va_start(%struct.va_list*)
13 declare void @llvm.va_start(i8*)
1714
0 ; Make sure this testcase codegens to the bic instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep {bic}
1 ; RUN: llvm-as < %s | llc -march=alpha | grep {bic}
22
3 implementation ; Functions:
4
5 long %bar(long %x, long %y) {
3 define i64 @bar(i64 %x, i64 %y) {
64 entry:
7 %tmp.1 = xor long %x, -1 ; [#uses=1]
8 %tmp.2 = and long %y, %tmp.1
9 ret long %tmp.2
5 %tmp.1 = xor i64 %x, -1 ; [#uses=1]
6 %tmp.2 = and i64 %y, %tmp.1 ; [#uses=1]
7 ret i64 %tmp.2
108 }
0 ; Make sure this testcase codegens the bsr instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep bsr
1 ; RUN: llvm-as < %s | llc -march=alpha | grep bsr
22
3 implementation
3 define internal i64 @abc(i32 %x) {
4 %tmp.2 = add i32 %x, -1 ; [#uses=1]
5 %tmp.0 = call i64 @abc( i32 %tmp.2 ) ; [#uses=1]
6 %tmp.5 = add i32 %x, -2 ; [#uses=1]
7 %tmp.3 = call i64 @abc( i32 %tmp.5 ) ; [#uses=1]
8 %tmp.6 = add i64 %tmp.0, %tmp.3 ; [#uses=1]
9 ret i64 %tmp.6
10 }
411
5 internal long %abc(int %x) {
6 %tmp.2 = add int %x, -1 ; [#uses=1]
7 %tmp.0 = call long %abc( int %tmp.2 ) ; [#uses=1]
8 %tmp.5 = add int %x, -2 ; [#uses=1]
9 %tmp.3 = call long %abc( int %tmp.5 ) ; [#uses=1]
10 %tmp.6 = add long %tmp.0, %tmp.3 ; [#uses=1]
11 ret long %tmp.6
12 }
0 ;All this should do is not crash
1 ;RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha
1 ;RUN: llvm-as < %s | llc -march=alpha
22
3 target endian = little
4 target pointersize = 64
3 target datalayout = "e-p:64:64"
54 target triple = "alphaev67-unknown-linux-gnu"
65
7 implementation ; Functions:
6 define void @_ZNSt13basic_filebufIcSt11char_traitsIcEE22_M_convert_to_externalEPcl(i32 %f) {
7 entry:
8 %tmp49 = alloca i8, i32 %f ; [#uses=0]
9 %tmp = call i32 null( i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null ) ; [#uses=0]
10 ret void
11 }
812
9 void %_ZNSt13basic_filebufIcSt11char_traitsIcEE22_M_convert_to_externalEPcl(uint %f) {
10 entry:
11 %tmp49 = alloca sbyte, uint %f ; [#uses=1]
12 %tmp = call uint null( sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null, sbyte* null)
13 ret void
14 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | not grep cmovlt
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmoveq
0 ; RUN: llvm-as < %s | llc -march=alpha | not grep cmovlt
1 ; RUN: llvm-as < %s | llc -march=alpha | grep cmoveq
22
3
4 long %cmov_lt(long %a, long %c) {
3 define i64 @cmov_lt(i64 %a, i64 %c) {
54 entry:
6 %tmp.1 = setlt long %c, 0
7 %retval = select bool %tmp.1, long %a, long 10
8 ret long %retval
5 %tmp.1 = icmp slt i64 %c, 0 ; [#uses=1]
6 %retval = select i1 %tmp.1, i64 %a, i64 10 ; [#uses=1]
7 ret i64 %retval
98 }
109
11 long %cmov_const(long %a, long %b, long %c) {
10 define i64 @cmov_const(i64 %a, i64 %b, i64 %c) {
1211 entry:
13 %tmp.1 = setlt long %a, %b
14 %retval = select bool %tmp.1, long %c, long 10
15 ret long %retval
12 %tmp.1 = icmp slt i64 %a, %b ; [#uses=1]
13 %retval = select i1 %tmp.1, i64 %c, i64 10 ; [#uses=1]
14 ret i64 %retval
1615 }
1716
18 long %cmov_lt2(long %a, long %c) {
17 define i64 @cmov_lt2(i64 %a, i64 %c) {
1918 entry:
20 %tmp.1 = setgt long %c, 0
21 %retval = select bool %tmp.1, long 10, long %a
22 ret long %retval
19 %tmp.1 = icmp sgt i64 %c, 0 ; [#uses=1]
20 %retval = select i1 %tmp.1, i64 10, i64 %a ; [#uses=1]
21 ret i64 %retval
2322 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmpbge | count 2
0 ; RUN: llvm-as < %s | llc -march=alpha | grep cmpbge | count 2
11
2 bool %test1(ulong %A, ulong %B) {
3 %C = and ulong %A, 255
4 %D = and ulong %B, 255
5 %E = setge ulong %C, %D
6 ret bool %E
2 define i1 @test1(i64 %A, i64 %B) {
3 %C = and i64 %A, 255 ; [#uses=1]
4 %D = and i64 %B, 255 ; [#uses=1]
5 %E = icmp uge i64 %C, %D ; [#uses=1]
6 ret i1 %E
77 }
88
9 bool %test2(ulong %a, ulong %B) {
10 %A = shl ulong %a, ubyte 1
11 %C = and ulong %A, 254
12 %D = and ulong %B, 255
13 %E = setge ulong %C, %D
14 ret bool %E
9 define i1 @test2(i64 %a, i64 %B) {
10 %A = shl i64 %a, 1 ; [#uses=1]
11 %C = and i64 %A, 254 ; [#uses=1]
12 %D = and i64 %B, 255 ; [#uses=1]
13 %E = icmp uge i64 %C, %D ; [#uses=1]
14 ret i1 %E
1515 }
0 ; Make sure this testcase does not use ctpop
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | not grep -i ctpop
1 ; RUN: llvm-as < %s | llc -march=alpha | not grep -i ctpop
22
3 declare ulong %llvm.ctlz.i64(ulong)
3 declare i64 @llvm.ctlz.i64(i64)
44
5 implementation ; Functions:
5 define i64 @bar(i64 %x) {
6 entry:
7 %tmp.1 = call i64 @llvm.ctlz.i64( i64 %x ) ; [#uses=1]
8 ret i64 %tmp.1
9 }
610
7 ulong %bar(ulong %x) {
8 entry:
9 %tmp.1 = call ulong %llvm.ctlz.i64( ulong %x )
10 ret ulong %tmp.1
11 }
0 ; Make sure this testcase codegens to the ctpop instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev67 | grep -i ctpop
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=+CIX | \
1 ; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctpop
2 ; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | \
33 ; RUN: grep -i ctpop
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev6 | \
4 ; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | \
55 ; RUN: not grep -i ctpop
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev56 | \
6 ; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | \
77 ; RUN: not grep -i ctpop
8 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=-CIX | \
8 ; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | \
99 ; RUN: not grep -i ctpop
1010
11 declare long %llvm.ctpop.i64(long)
11 declare i64 @llvm.ctpop.i64(i64)
1212
13 implementation ; Functions:
13 define i64 @bar(i64 %x) {
14 entry:
15 %tmp.1 = call i64 @llvm.ctpop.i64( i64 %x ) ; [#uses=1]
16 ret i64 %tmp.1
17 }
1418
15 long %bar(long %x) {
16 entry:
17 %tmp.1 = call long %llvm.ctpop.i64( long %x )
18 ret long %tmp.1
19 }
0 ; Make sure this testcase codegens to the eqv instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep eqv
1 ; RUN: llvm-as < %s | llc -march=alpha | grep eqv
22
3 implementation ; Functions:
3 define i64 @bar(i64 %x, i64 %y) {
4 entry:
5 %tmp.1 = xor i64 %x, -1 ; [#uses=1]
6 %tmp.2 = xor i64 %y, %tmp.1 ; [#uses=1]
7 ret i64 %tmp.2
8 }
49
5 long %bar(long %x, long %y) {
6 entry:
7 %tmp.1 = xor long %x, -1 ; [#uses=1]
8 %tmp.2 = xor long %y, %tmp.1
9 ret long %tmp.2
10 }
0 ; try to check that we have the most important instructions, which shouldn't
11 ; appear otherwise
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jmp
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep gprel32
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ldl
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep rodata
6 ; END.
2 ; RUN: llvm-as < %s | llc -march=alpha | grep jmp
3 ; RUN: llvm-as < %s | llc -march=alpha | grep gprel32
4 ; RUN: llvm-as < %s | llc -march=alpha | grep ldl
5 ; RUN: llvm-as < %s | llc -march=alpha | grep rodata
76
8 target endian = little
9 target pointersize = 64
7 target datalayout = "e-p:64:64"
108 target triple = "alphaev67-unknown-linux-gnu"
11 %str = internal constant [2 x sbyte] c"1\00" ; <[2 x sbyte]*> [#uses=1]
12 %str1 = internal constant [2 x sbyte] c"2\00" ; <[2 x sbyte]*> [#uses=1]
13 %str2 = internal constant [2 x sbyte] c"3\00" ; <[2 x sbyte]*> [#uses=1]
14 %str3 = internal constant [2 x sbyte] c"4\00" ; <[2 x sbyte]*> [#uses=1]
15 %str4 = internal constant [2 x sbyte] c"5\00" ; <[2 x sbyte]*> [#uses=1]
16 %str5 = internal constant [2 x sbyte] c"6\00" ; <[2 x sbyte]*> [#uses=1]
17 %str6 = internal constant [2 x sbyte] c"7\00" ; <[2 x sbyte]*> [#uses=1]
18 %str7 = internal constant [2 x sbyte] c"8\00" ; <[2 x sbyte]*> [#uses=1]
9 @str = internal constant [2 x i8] c"1\00" ; <[2 x i8]*> [#uses=1]
10 @str1 = internal constant [2 x i8] c"2\00" ; <[2 x i8]*> [#uses=1]
11 @str2 = internal constant [2 x i8] c"3\00" ; <[2 x i8]*> [#uses=1]
12 @str3 = internal constant [2 x i8] c"4\00" ; <[2 x i8]*> [#uses=1]
13 @str4 = internal constant [2 x i8] c"5\00" ; <[2 x i8]*> [#uses=1]
14 @str5 = internal constant [2 x i8] c"6\00" ; <[2 x i8]*> [#uses=1]
15 @str6 = internal constant [2 x i8] c"7\00" ; <[2 x i8]*> [#uses=1]
16 @str7 = internal constant [2 x i8] c"8\00" ; <[2 x i8]*> [#uses=1]
1917
20 implementation ; Functions:
18 define i32 @main(i32 %x, i8** %y) {
19 entry:
20 %x_addr = alloca i32 ; [#uses=2]
21 %y_addr = alloca i8** ; [#uses=1]
22 %retval = alloca i32, align 4 ; [#uses=2]
23 %tmp = alloca i32, align 4 ; [#uses=2]
24 %foo = alloca i8*, align 8 ; [#uses=9]
25 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
26 store i32 %x, i32* %x_addr
27 store i8** %y, i8*** %y_addr
28 %tmp.upgrd.1 = load i32* %x_addr ; [#uses=1]
29 switch i32 %tmp.upgrd.1, label %bb15 [
30 i32 1, label %bb
31 i32 2, label %bb1
32 i32 3, label %bb3
33 i32 4, label %bb5
34 i32 5, label %bb7
35 i32 6, label %bb9
36 i32 7, label %bb11
37 i32 8, label %bb13
38 ]
2139
22 int %main(int %x, sbyte** %y) {
23 entry:
24 %x_addr = alloca int ; [#uses=2]
25 %y_addr = alloca sbyte** ; [#uses=1]
26 %retval = alloca int, align 4 ; [#uses=2]
27 %tmp = alloca int, align 4 ; [#uses=2]
28 %foo = alloca sbyte*, align 8 ; [#uses=9]
29 "alloca point" = cast int 0 to int ; [#uses=0]
30 store int %x, int* %x_addr
31 store sbyte** %y, sbyte*** %y_addr
32 %tmp = load int* %x_addr ; [#uses=1]
33 switch int %tmp, label %bb15 [
34 int 1, label %bb
35 int 2, label %bb1
36 int 3, label %bb3
37 int 4, label %bb5
38 int 5, label %bb7
39 int 6, label %bb9
40 int 7, label %bb11
41 int 8, label %bb13
42 ]
40 bb: ; preds = %entry
41 %tmp.upgrd.2 = getelementptr [2 x i8]* @str, i32 0, i64 0 ; [#uses=1]
42 store i8* %tmp.upgrd.2, i8** %foo
43 br label %bb16
4344
44 bb: ; preds = %entry
45 %tmp = getelementptr [2 x sbyte]* %str, int 0, ulong 0 ; [#uses=1]
46 store sbyte* %tmp, sbyte** %foo
47 br label %bb16
45 bb1: ; preds = %entry
46 %tmp2 = getelementptr [2 x i8]* @str1, i32 0, i64 0 ; [#uses=1]
47 store i8* %tmp2, i8** %foo
48 br label %bb16
4849
49 bb1: ; preds = %entry
50 %tmp2 = getelementptr [2 x sbyte]* %str1, int 0, ulong 0 ; [#uses=1]
51 store sbyte* %tmp2, sbyte** %foo
52 br label %bb16
50 bb3: ; preds = %entry
51 %tmp4 = getelementptr [2 x i8]* @str2, i32 0, i64 0 ; [#uses=1]
52 store i8* %tmp4, i8** %foo
53 br label %bb16
5354
54 bb3: ; preds = %entry
55 %tmp4 = getelementptr [2 x sbyte]* %str2, int 0, ulong 0 ; [#uses=1]
56 store sbyte* %tmp4, sbyte** %foo
57 br label %bb16
55 bb5: ; preds = %entry
56 %tmp6 = getelementptr [2 x i8]* @str3, i32 0, i64 0 ; [#uses=1]
57 store i8* %tmp6, i8** %foo
58 br label %bb16
5859
59 bb5: ; preds = %entry
60 %tmp6 = getelementptr [2 x sbyte]* %str3, int 0, ulong 0 ; [#uses=1]
61 store sbyte* %tmp6, sbyte** %foo
62 br label %bb16
60 bb7: ; preds = %entry
61 %tmp8 = getelementptr [2 x i8]* @str4, i32 0, i64 0 ; [#uses=1]
62 store i8* %tmp8, i8** %foo
63 br label %bb16
6364
64 bb7: ; preds = %entry
65 %tmp8 = getelementptr [2 x sbyte]* %str4, int 0, ulong 0 ; [#uses=1]
66 store sbyte* %tmp8, sbyte** %foo
67 br label %bb16
65 bb9: ; preds = %entry
66 %tmp10 = getelementptr [2 x i8]* @str5, i32 0, i64 0 ; [#uses=1]
67 store i8* %tmp10, i8** %foo
68 br label %bb16
6869
69 bb9: ; preds = %entry
70 %tmp10 = getelementptr [2 x sbyte]* %str5, int 0, ulong 0 ; [#uses=1]
71 store sbyte* %tmp10, sbyte** %foo
72 br label %bb16
70 bb11: ; preds = %entry
71 %tmp12 = getelementptr [2 x i8]* @str6, i32 0, i64 0 ; [#uses=1]
72 store i8* %tmp12, i8** %foo
73 br label %bb16
7374
74 bb11: ; preds = %entry
75 %tmp12 = getelementptr [2 x sbyte]* %str6, int 0, ulong 0 ; [#uses=1]
76 store sbyte* %tmp12, sbyte** %foo
77 br label %bb16
75 bb13: ; preds = %entry
76 %tmp14 = getelementptr [2 x i8]* @str7, i32 0, i64 0 ; [#uses=1]
77 store i8* %tmp14, i8** %foo
78 br label %bb16
7879
79 bb13: ; preds = %entry
80 %tmp14 = getelementptr [2 x sbyte]* %str7, int 0, ulong 0 ; [#uses=1]
81 store sbyte* %tmp14, sbyte** %foo
82 br label %bb16
80 bb15: ; preds = %entry
81 br label %bb16
8382
84 bb15: ; preds = %entry
85 br label %bb16
83 bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
84 %tmp17 = load i8** %foo ; [#uses=1]
85 %tmp18 = call i32 (...)* @print( i8* %tmp17 ) ; [#uses=0]
86 store i32 0, i32* %tmp
87 %tmp19 = load i32* %tmp ; [#uses=1]
88 store i32 %tmp19, i32* %retval
89 br label %return
8690
87 bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
88 %tmp17 = load sbyte** %foo ; [#uses=1]
89 %tmp18 = call int (...)* %print( sbyte* %tmp17 ) ; [#uses=0]
90 store int 0, int* %tmp
91 %tmp19 = load int* %tmp ; [#uses=1]
92 store int %tmp19, int* %retval
93 br label %return
94
95 return: ; preds = %bb16
96 %retval = load int* %retval ; [#uses=1]
97 ret int %retval
91 return: ; preds = %bb16
92 %retval.upgrd.3 = load i32* %retval ; [#uses=1]
93 ret i32 %retval.upgrd.3
9894 }
9995
100 declare int %print(...)
96 declare i32 @print(...)
97
0 ; Make sure this testcase does not use mulq
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | \
1 ; RUN: llvm-as < %s | llvm-as | llc -march=alpha | \
22 ; RUN: not grep -i mul
33 ; XFAIL: *
44
5 implementation ; Functions:
6
7 ulong %foo1(ulong %x) {
5 define i64 @foo1(i64 %x) {
86 entry:
9 %tmp.1 = mul ulong %x, 9 ; [#uses=1]
10 ret ulong %tmp.1
11 }
12 ulong %foo3(ulong %x) {
13 entry:
14 %tmp.1 = mul ulong %x, 259
15 ret ulong %tmp.1
7 %tmp.1 = mul i64 %x, 9 ; [#uses=1]
8 ret i64 %tmp.1
169 }
1710
18 ulong %foo4l(ulong %x) {
11 define i64 @foo3(i64 %x) {
1912 entry:
20 %tmp.1 = mul ulong %x, 260
21 ret ulong %tmp.1
13 %tmp.1 = mul i64 %x, 259 ; [#uses=1]
14 ret i64 %tmp.1
2215 }
2316
24 ulong %foo4ln(ulong %x) {
17 define i64 @foo4l(i64 %x) {
2518 entry:
26 %tmp.1 = mul ulong %x, 508
27 ret ulong %tmp.1
28 }
29 ulong %foo4ln_more(ulong %x) {
30 entry:
31 %tmp.1 = mul ulong %x, 252
32 ret ulong %tmp.1
19 %tmp.1 = mul i64 %x, 260 ; [#uses=1]
20 ret i64 %tmp.1
3321 }
3422
35 ulong %foo1n(ulong %x) {
23 define i64 @foo4ln(i64 %x) {
3624 entry:
37 %tmp.1 = mul ulong %x, 511
38 ret ulong %tmp.1
25 %tmp.1 = mul i64 %x, 508 ; [#uses=1]
26 ret i64 %tmp.1
3927 }
4028
41 ulong %foo8l(ulong %x) {
29 define i64 @foo4ln_more(i64 %x) {
4230 entry:
43 %tmp.1 = mul ulong %x, 768
44 ret ulong %tmp.1
31 %tmp.1 = mul i64 %x, 252 ; [#uses=1]
32 ret i64 %tmp.1
4533 }
4634
47 long %bar(long %x) {
35 define i64 @foo1n(i64 %x) {
4836 entry:
49 %tmp.1 = mul long %x, 5 ; [#uses=1]
50 ret long %tmp.1
37 %tmp.1 = mul i64 %x, 511 ; [#uses=1]
38 ret i64 %tmp.1
5139 }
40
41 define i64 @foo8l(i64 %x) {
42 entry:
43 %tmp.1 = mul i64 %x, 768 ; [#uses=1]
44 ret i64 %tmp.1
45 }
46
47 define i64 @bar(i64 %x) {
48 entry:
49 %tmp.1 = mul i64 %x, 5 ; [#uses=1]
50 ret i64 %tmp.1
51 }
52
0 ; Make sure this testcase codegens to the lda -1 instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep {\\-1}
1 ; RUN: llvm-as < %s | llc -march=alpha | grep {\\-1}
22
3 implementation ; Functions:
4
5 long %bar() {
3 define i64 @bar() {
64 entry:
7 ret long -1
5 ret i64 -1
86 }
0 ; Make sure this testcase codegens to the ornot instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep eqv
1 ; RUN: llvm-as < %s | llc -march=alpha | grep eqv
22
3 implementation ; Functions:
4
5 long %bar(long %x) {
3 define i64 @bar(i64 %x) {
64 entry:
7 %tmp.1 = xor long %x, -1 ; [#uses=1]
8 ret long %tmp.1
5 %tmp.1 = xor i64 %x, -1 ; [#uses=1]
6 ret i64 %tmp.1
97 }
0 ; Make sure this testcase codegens to the ornot instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ornot
1 ; RUN: llvm-as < %s | llc -march=alpha | grep ornot
22
3 implementation ; Functions:
3 define i64 @bar(i64 %x, i64 %y) {
4 entry:
5 %tmp.1 = xor i64 %x, -1 ; [#uses=1]
6 %tmp.2 = or i64 %y, %tmp.1 ; [#uses=1]
7 ret i64 %tmp.2
8 }
49
5 long %bar(long %x, long %y) {
6 entry:
7 %tmp.1 = xor long %x, -1 ; [#uses=1]
8 %tmp.2 = or long %y, %tmp.1
9 ret long %tmp.2
10 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep rpcc
0 ; RUN: llvm-as < %s | llc -march=alpha | grep rpcc
11
2 declare ulong %llvm.readcyclecounter()
2 declare i64 @llvm.readcyclecounter()
33
4 ulong %foo() {
4 define i64 @foo() {
55 entry:
6 %tmp.1 = call ulong %llvm.readcyclecounter ()
7 ret ulong %tmp.1
6 %tmp.1 = call i64 @llvm.readcyclecounter( ) ; [#uses=1]
7 ret i64 %tmp.1
88 }
9
0 ; Make sure this testcase codegens to the zapnot instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
1 ; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
22
3 ulong %foo(ulong %y) {
3 define i64 @foo(i64 %y) {
44 entry:
5 %tmp = shr ulong %y, ubyte 3 ; [#uses=1]
6 %tmp2 = and ulong %tmp, 8191 ; [#uses=1]
7 ret ulong %tmp2
5 %tmp = lshr i64 %y, 3 ; [#uses=1]
6 %tmp2 = and i64 %tmp, 8191 ; [#uses=1]
7 ret i64 %tmp2
88 }
99
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*f
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep .weak.*h
0 ; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*f
1 ; RUN: llvm-as < %s | llc -march=alpha | grep .weak.*h
22
3 implementation ; Functions:
4
5 weak uint %f() {
3 define weak i32 @f() {
64 entry:
7 unreachable
5 unreachable
86 }
97
10 void %g() {
8 define void @g() {
119 entry:
12 tail call void %h( )
10 tail call void @h( )
1311 ret void
1412 }
1513
16 declare extern_weak void %h()
14 declare extern_weak void @h()
15
0 ; Make sure this testcase codegens to the zapnot instruction
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
1 ; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
22
3 implementation ; Functions:
3 define i64 @bar(i64 %x) {
4 entry:
5 %tmp.1 = and i64 %x, 16711935 ; [#uses=1]
6 ret i64 %tmp.1
7 }
48
5 long %bar(long %x) {
6 entry:
7 %tmp.1 = and long %x, 16711935 ; [#uses=1]
8 ret long %tmp.1
9 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
0 ; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
11
22 ;demanded bits mess up this mask in a hard to fix way
3 ;ulong %foo(ulong %y) {
4 ; %tmp = and ulong %y, 65535
5 ; %tmp2 = shr ulong %tmp, ubyte 3
6 ; ret ulong %tmp2
3 ;define i64 @foo(i64 %y) {
4 ; %tmp = and i64 %y, 65535
5 ; %tmp2 = shr i64 %tmp, i8 3
6 ; ret i64 %tmp2
77 ;}
88
9 ulong %foo2(ulong %y) {
10 %tmp = shr ulong %y, ubyte 3 ; [#uses=1]
11 %tmp2 = and ulong %tmp, 8191 ; [#uses=1]
12 ret ulong %tmp2
9 define i64 @foo2(i64 %y) {
10 %tmp = lshr i64 %y, 3 ; [#uses=1]
11 %tmp2 = and i64 %tmp, 8191 ; [#uses=1]
12 ret i64 %tmp2
1313 }
1414
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep zapnot
0 ; RUN: llvm-as < %s | llc -march=alpha | grep zapnot
11
2 ulong %foo(ulong %y) {
3 %tmp = shl ulong %y, ubyte 3 ; [#uses=1]
4 %tmp2 = and ulong %tmp, 65535 ; [#uses=1]
5 ret ulong %tmp2
2 define i64 @foo(i64 %y) {
3 %tmp = shl i64 %y, 3 ; [#uses=1]
4 %tmp2 = and i64 %tmp, 65535 ; [#uses=1]
5 ret i64 %tmp2
66 }
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; Make sure that global variables do not collide if they have the same name,
33 ; but different types.
44
5 %X = global int 5
6 %X = global long 7
5 @X = global i32 5 ; [#uses=0]
6 @X.upgrd.1 = global i64 7 ; [#uses=0]
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; This case was emitting code that looked like this:
33 ; ...
77 ; Which the Sun C compiler rejected, so now we are sure to put a return
88 ; instruction in there if the basic block is otherwise empty.
99 ;
10 void "test"() {
11 br label %BB1
12 BB2:
13 br label %BB2
14 BB1:
15 ret void
10 define void @test() {
11 br label %BB1
12
13 BB2: ; preds = %BB2
14 br label %BB2
15
16 BB1: ; preds = %0
17 ret void
1618 }
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; Test const pointer refs & forward references
33
4 %t3 = global int * %t1 ;; Forward reference
5 %t1 = global int 4
4 @t3 = global i32* @t1 ; [#uses=0]
5 @t1 = global i32 4 ; [#uses=1]
66
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 global int* cast (float* %0 to int*) ;; Forward numeric reference
3 global float* %0 ;; Duplicate forward numeric reference
2 global i32* bitcast (float* @2 to i32*) ;; Forward numeric reference
3 global float* @2 ;; Duplicate forward numeric reference
44 global float 0.0
55
6 %array = constant [2 x int] [ int 12, int 52 ]
7 %arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ;; int* &%array[0][0]
8
6 @array = constant [2 x i32] [ i32 12, i32 52 ]
7 @arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %sptr1 = global [11x sbyte]* %somestr ;; Forward ref to a constant
3 %somestr = constant [11x sbyte] c"hello world"
4
2 @sptr1 = global [11 x i8]* @somestr ;; Forward ref to a constant
3 @somestr = constant [11 x i8] c"hello world"
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %fptr = global void() * %f ;; Forward ref method defn
3 declare void "f"() ;; External method
2 @fptr = global void ()* @f ;; Forward ref method defn
3 declare void @f() ;; External method
44
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %array = constant [2 x int] [ int 12, int 52 ] ; <[2 x int]*> [#uses=1]
3 %arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0) ; *> [#uses=1]
2 @array = constant [2 x i32] [ i32 12, i32 52 ] ; <[2 x i32]*> [#uses=1]
3 @arrayPtr = global i32* getelementptr ([2 x i32]* @array, i64 0, i64 0) ; [#uses=0]
44
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %MyIntList = uninitialized global { \2 *, int }
3
2 @MyIntList = external global { \2*, i32 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; The C Writer bombs on this testcase because it tries the print the prototype
33 ; for the test function, which tries to print the argument name. The function
44 ; has not been incorporated into the slot calculator, so after it does the name
55 ; lookup, it tries a slot calculator lookup, which fails.
66
7 int %test(int) {
8 ret int 0
7 define i32 @test(i32) {
8 ret i32 0
99 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; Indirect function call test... found by Joel & Brian
33 ;
44
5 %taskArray = uninitialized global int*
5 @taskArray = external global i32* ; [#uses=1]
66
7 void %test(int %X) {
8 %Y = add int %X, -1 ; :1 [#uses=3]
9 %cast100 = cast int %Y to long ; [#uses=1]
10 %gep100 = getelementptr int** %taskArray, long %cast100 ; [#uses=1]
11 %fooPtr = load int** %gep100 ; [#uses=1]
12 %cast101 = cast int* %fooPtr to void (int)* ; [#uses=1]
13 call void %cast101( int 1000 )
14 ret void
7 define void @test(i32 %X) {
8 %Y = add i32 %X, -1 ; [#uses=1]
9 %cast100 = sext i32 %Y to i64 ; [#uses=1]
10 %gep100 = getelementptr i32** @taskArray, i64 %cast100 ; [#uses=1]
11 %fooPtr = load i32** %gep100 ; [#uses=1]
12 %cast101 = bitcast i32* %fooPtr to void (i32)* ; [#uses=1]
13 call void %cast101( i32 1000 )
14 ret void
1515 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; This testcase fails because the C backend does not arrange to output the
33 ; contents of a structure type before it outputs the structure type itself.
44
5 %Y = uninitialized global { {int } }
6 %X = uninitialized global { float }
5 @Y = external global { { i32 } } ; <{ { i32 } }*> [#uses=0]
6 @X = external global { float } ; <{ float }*> [#uses=0]
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 define void @test() {
3 %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=0]
4 ret void
5 }
26
3
4 implementation
5
6 void %test() {
7 %X = alloca [4xint]
8 ret void
9 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22
3 declare void %foo(...)
3 declare void @foo(...)
44
55
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %MPI_Comm = type %struct.Comm*
3 %struct.Comm = type opaque
4 %thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
2 %MPI_Comm = type %struct.Comm*
3 %struct.Comm = type opaque
4 @thing = global %MPI_Comm* null ; <%MPI_Comm**> [#uses=0]
55
6 implementation ; Functions:
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %bob = external global int ; [#uses=2]
2 @bob = external global i32 ; [#uses=0]
33
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %BitField = type i32
3 %tokenptr = type i32*
24
3 %BitField = type int
4 %tokenptr = type %BitField*
5 define void @test() {
6 %pmf1 = alloca %tokenptr (%tokenptr, i8*)* ; <%tokenptr (%tokenptr, i8*)**> [#uses=0]
7 ret void
8 }
59
6 implementation
7
8 void %test() {
9 %pmf1 = alloca %tokenptr (%tokenptr, sbyte*)*
10 ret void
11 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %testString = internal constant [18 x sbyte] c "Escaped newline\n\00"
2 @testString = internal constant [18 x i8] c"Escaped newline\5Cn\00" ; <[18 x i8]*> [#uses=1]
33
4 implementation
4 declare i32 @printf(i8*, ...)
55
6 declare int %printf(sbyte*, ...)
6 define i32 @main() {
7 call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @testString, i64 0, i64 0) ) ; :1 [#uses=0]
8 ret i32 0
9 }
710
8 int %main() {
9 call int (sbyte*, ...)* %printf( sbyte* getelementptr ([18 x sbyte]* %testString, long 0, long 0))
10 ret int 0
11 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; Apparently this constant was unsigned in ISO C 90, but not in C 99.
33
4 int %foo() {
5 ret int -2147483648
4 define i32 @foo() {
5 ret i32 -2147483648
66 }
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; This testcase breaks the C backend, because gcc doesn't like (...) functions
33 ; with no arguments at all.
44
5 void %test(long %Ptr) {
6 %P = cast long %Ptr to void(...) *
7 call void(...)* %P(long %Ptr)
8 ret void
5 define void @test(i64 %Ptr) {
6 %P = inttoptr i64 %Ptr to void (...)* ; [#uses=1]
7 call void (...)* %P( i64 %Ptr )
8 ret void
99 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; The C backend was dying when there was no typename for a struct type!
33
4 declare int %test(int,{ [32 x int] }*)
5
4 declare i32 @test(i32, { [32 x i32] }*)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %X = type { i32, float }
23
3 %X = type { int, float }
4 define void @test() {
5 getelementptr %X* null, i64 0, i32 1 ; :1 [#uses=0]
6 ret void
7 }
48
5 void %test() {
6 getelementptr %X* null, long 0, uint 1
7 ret void
8 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; Make sure hex constant does not continue into a valid hexadecimal letter/number
3 %version = global [3 x sbyte] c"\001\00"
4
3 @version = global [3 x i8] c"\001\00"
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2
3 %version = global [3 x sbyte] c"1\00\00"
4
2 @version = global [3 x i8] c"1\00\00"
0
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c > %t1.cbe.c
1 ; RUN: llvm-as < %s | llc -march=c > %t1.cbe.c
22 ; RUN: gcc -B/usr/bin/ %t1.cbe.c -o %t1.cbe
33 ; RUN: ./%t1.cbe
44
5 bool %doTest(ubyte %x) {
6 %dec.0 = add ubyte %x, 255
7 %tmp.1001 = trunc ubyte %dec.0 to bool
8 ret bool %tmp.1001
5 define i1 @doTest(i8 %x) {
6 %dec.0 = add i8 %x, -1 ; [#uses=1]
7 %tmp.1001 = trunc i8 %dec.0 to i1 ; [#uses=1]
8 ret i1 %tmp.1001
99 }
1010
11 int %main () {
12 %result = call bool %doTest(ubyte 1)
13 %p = cast bool %result to int
14 ret int %p
11 define i32 @main() {
12 %result = call i1 @doTest( i8 1 ) ; [#uses=1]
13 %p = zext i1 %result to i32 ; [#uses=1]
14 ret i32 %p
1515 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 declare i32 @callee(i32, i32)
23
3 declare int %callee(int, int)
4 define i32 @test(i32 %X) {
5 ;
6 %A = invoke i32 @callee( i32 %X, i32 5 )
7 to label %Ok unwind label %Threw ; [#uses=1]
48
9 Ok: ; preds = %Threw, %0
10 %B = phi i32 [ %A, %0 ], [ -1, %Threw ] ; [#uses=1]
11 ret i32 %B
512
6 int %test(int %X) {
7 %A = invoke int %callee(int %X, int 5) to label %Ok except label %Threw
8 Ok:
9 %B = phi int [%A, %0], [-1, %Threw]
10 ret int %B
11 Threw:
12 br label %Ok
13 Threw: ; preds = %0
14 br label %Ok
1315 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep common | grep X
0 ; RUN: llvm-as < %s | llc -march=c | grep common | grep X
11
2 %X = linkonce global int 5
3
2 @X = linkonce global i32 5
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; This is a non-normal FP value: it's a nan.
3 %NAN = global { float } { float 0x7FF8000000000000 }
4 %NANs = global { float } { float 0x7FF4000000000000 }
3 @NAN = global { float } { float 0x7FF8000000000000 } ; <{ float }*> [#uses=0]
4 @NANs = global { float } { float 0x7FFC000000000000 } ; <{ float }*> [#uses=0]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %A = type { i32, i8*, { i32, i32, i32, i32, i32, i32, i32, i32 }*, i16 }
23
3 %A = type { uint, sbyte*, { uint, uint, uint, uint, uint, uint, uint, uint }*, ushort }
4 define void @test(%A*) {
5 ret void
6 }
47
5 void %test(%A *) { ret void }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
22 ; reduced from DOOM.
3 %union._XEvent = type { int }
4 %.X_event_9 = global %union._XEvent zeroinitializer
3 %union._XEvent = type { i32 }
4 @.X_event_9 = global %union._XEvent zeroinitializer ; <%union._XEvent*> [#uses=1]
55
6 implementation ; Functions:
7 void %I_InitGraphics() {
8 shortcirc_next.3: ; preds = %no_exit.1
9 %tmp.319 = load int* getelementptr ({ int, int }* cast (%union._XEvent* %.X_event_9 to { int, int }*), long 0, uint 1) ; [#uses=1]
10 ret void
6 define void @I_InitGraphics() {
7 shortcirc_next.3:
8 %tmp.319 = load i32* getelementptr ({ i32, i32 }* bitcast (%union._XEvent* @.X_event_9 to { i32, i32 }*), i64 0, i32 1) ; [#uses=0]
9 ret void
1110 }
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
1 @y = weak global i8 0 ; [#uses=1]
12
2 %y = weak global sbyte 0
3 implementation
4 uint %testcaseshr() {
3 define i32 @testcaseshr() {
54 entry:
6 ret uint shr (uint cast (sbyte* %y to uint), ubyte 4)
5 ret i32 lshr (i32 ptrtoint (i8* @y to i32), i32 4)
76 }
8 uint %testcaseshl() {
7
8 define i32 @testcaseshl() {
99 entry:
10 ret uint shl (uint cast (sbyte* %y to uint), ubyte 4)
10 ret i32 shl (i32 ptrtoint (i8* @y to i32), i32 4)
1111 }
12
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep builtin_return_address
0 ; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address
11
2 declare sbyte* %llvm.returnaddress(uint)
3 declare sbyte* %llvm.frameaddress(uint)
2 declare i8* @llvm.returnaddress(i32)
43
5 sbyte *%test1() {
6 %X = call sbyte* %llvm.returnaddress(uint 0)
7 ret sbyte* %X
4 declare i8* @llvm.frameaddress(i32)
5
6 define i8* @test1() {
7 %X = call i8* @llvm.returnaddress( i32 0 ) ; [#uses=1]
8 ret i8* %X
89 }
910
10 sbyte *%test2() {
11 %X = call sbyte* %llvm.frameaddress(uint 0)
12 ret sbyte* %X
11 define i8* @test2() {
12 %X = call i8* @llvm.frameaddress( i32 0 ) ; [#uses=1]
13 ret i8* %X
1314 }
15
33 ; this testcase for example, which caused the CBE to mangle one, screwing
44 ; everything up. :( Test that this does not happen anymore.
55 ;
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep _memcpy
6 ; RUN: llvm-as < %s | llc -march=c | not grep _memcpy
77
8 declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint,uint)
9 declare float* %memcpy(int*, uint,int)
8 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
109
11 int %test(sbyte *%A, sbyte* %B, int* %C) {
12 call float* %memcpy(int* %C, uint 4, int 17)
13 call void %llvm.memcpy.i32(sbyte* %A, sbyte* %B, uint 123, uint 14)
14 ret int 7
10 declare float* @memcpy(i32*, i32, i32)
11
12 define i32 @test(i8* %A, i8* %B, i32* %C) {
13 call float* @memcpy( i32* %C, i32 4, i32 17 ) ; :1 [#uses=0]
14 call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 )
15 ret i32 7
1516 }
17
0 ; This is a non-normal FP value
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep FPConstant | grep static
1 ; RUN: llvm-as < %s | llc -march=c | grep FPConstant | grep static
22
3 float %func () {
4 ret float 0xFFF0000000000000 ; -inf
3 define float @func() {
4 ret float 0xFFF0000000000000
55 }
66
7 double %func2() {
8 ret double 0xFF20000000000000 ; -inf
7 define double @func2() {
8 ret double 0xFF20000000000000
99 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep func1 | grep WEAK
0 ; RUN: llvm-as < %s | llc -march=c | grep func1 | grep WEAK
11
2 implementation
3
4 linkonce int %func1 () {
5 ret int 5
2 define linkonce i32 @func1() {
3 ret i32 5
64 }
75
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 declare void %llvm.va_end(sbyte*)
2 declare void @llvm.va_end(i8*)
33
4 void %test() {
5 call void %llvm.va_end( sbyte* null )
6 ret void
4 define void @test() {
5 %va.upgrd.1 = bitcast i8* null to i8* ; [#uses=1]
6 call void @llvm.va_end( i8* %va.upgrd.1 )
7 ret void
78 }
89
0 ; The CBE should not emit code that casts the function pointer. This causes
11 ; GCC to get testy and insert trap instructions instead of doing the right
22 ; thing. :(
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
3 ; RUN: llvm-as < %s | llc -march=c
44
5 implementation
5 declare void @external(i8*)
66
7 declare void %external(sbyte*)
8
9 int %test(int *%X) {
10 %RV = call int (int*)* cast (void(sbyte*)* %external to int(int*)*)(int* %X)
11 ret int %RV
7 define i32 @test(i32* %X) {
8 %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; [#uses=1]
9 ret i32 %RV
1210 }
1311
14
15
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep extern.*msg
0 ; RUN: llvm-as < %s | llc -march=c | not grep extern.*msg
1 ; PR472
12
2 ; This is PR472
3 @msg = internal global [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1]
34
4 %msg = internal global [6 x sbyte] c"hello\00"
5 define i8* @foo() {
6 entry:
7 ret i8* getelementptr ([6 x i8]* @msg, i32 0, i32 0)
8 }
59
6 implementation ; Functions:
7
8 sbyte* %foo() {
9 entry:
10 ret sbyte* getelementptr ([6 x sbyte]* %msg, int 0, int 0)
11 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 int %foo() {
3 ret int and (int 123456, int cast (int()* %foo to int))
2 define i32 @foo() {
3 ret i32 and (i32 123456, i32 ptrtoint (i32 ()* @foo to i32))
44 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep volatile
0 ; RUN: llvm-as < %s | llc -march=c | grep volatile
11
2 void %test(int* %P) {
3 %X = volatile load int*%P
4 volatile store int %X, int* %P
5 ret void
2 define void @test(i32* %P) {
3 %X = volatile load i32* %P ; [#uses=1]
4 volatile store i32 %X, i32* %P
5 ret void
66 }
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c
0 ; RUN: llvm-as < %s | llc -march=c
11
2 %JNIEnv = type %struct.JNINa*
3 %struct.JNINa = type { sbyte*, sbyte*, sbyte*, void (%JNIEnv*)* }
2 %JNIEnv = type %struct.JNINa*
3 %struct.JNINa = type { i8*, i8*, i8*, void (%JNIEnv*)* }
44
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep -- --65535
0 ; RUN: llvm-as < %s | llc -march=c | not grep -- --65535
11 ; PR596
22
3 target endian = little
4 target pointersize = 32
3 target datalayout = "e-p:32:32"
54 target triple = "i686-pc-linux-gnu"
65
7 implementation ; Functions:
6 declare void @func(i32)
87
9 declare void %func(int)
8 define void @funcb() {
9 entry:
10 %tmp.1 = sub i32 0, -65535 ; [#uses=1]
11 call void @func( i32 %tmp.1 )
12 br label %return
1013
11 void %funcb() {
12 entry:
13 %tmp.1 = sub int 0, -65535 ; [#uses=1]
14 call void %func( int %tmp.1 )
15 br label %return
14 return: ; preds = %entry
15 ret void
16 }
1617
17 return: ; preds = %entry
18 ret void
19 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep fmod
0 ; RUN: llvm-as < %s | llc -march=c | grep fmod
11
2 double %test(double %A, double %B) {
3 %C = rem double %A, %B
4 ret double %C
2 define double @test(double %A, double %B) {
3 %C = frem double %A, %B ; [#uses=1]
4 ret double %C
55 }
6
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | grep {\\* *volatile *\\*}
0 ; RUN: llvm-as < %s | llc -march=c | grep {\\* *volatile *\\*}
11
2 %G = external global void()*
2 @G = external global void ()* ; [#uses=2]
33
4 void %test() {
5 volatile store void()* %test, void()** %G
6 volatile load void()** %G
7 ret void
4 define void @test() {
5 volatile store void ()* @test, void ()** @G
6 volatile load void ()** @G ; :1 [#uses=0]
7 ret void
88 }
9
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | \
0 ; RUN: llvm-as < %s | llc -march=c | \
11 ; RUN: grep __BITCAST | count 14
22
3 int %test1(float %F) {
4 %X = bitcast float %F to int
5 ret int %X
3 define i32 @test1(float %F) {
4 %X = bitcast float %F to i32 ; [#uses=1]
5 ret i32 %X
66 }
77
8 float %test2(int %I) {
9 %X = bitcast int %I to float
10 ret float %X
8 define float @test2(i32 %I) {
9 %X = bitcast i32 %I to float ; [#uses=1]
10 ret float %X
1111 }
1212
13 long %test3(double %D) {
14 %X = bitcast double %D to long
15 ret long %X
13 define i64 @test3(double %D) {
14 %X = bitcast double %D to i64 ; [#uses=1]
15 ret i64 %X
1616 }
1717
18 double %test4(long %L) {
19 %X = bitcast long %L to double
20 ret double %X
18 define double @test4(i64 %L) {
19 %X = bitcast i64 %L to double ; [#uses=1]
20 ret double %X
2121 }
2222
23 double %test5(double %D) {
24 %X = bitcast double %D to double
25 %Y = add double %X, 2.0
26 %Z = bitcast double %Y to long
27 %res = bitcast long %Z to double
28 ret double %res
23 define double @test5(double %D) {
24 %X = bitcast double %D to double ; [#uses=1]
25 %Y = add double %X, 2.000000e+00 ; [#uses=1]
26 %Z = bitcast double %Y to i64 ; [#uses=1]
27 %res = bitcast i64 %Z to double ; [#uses=1]
28 ret double %res
2929 }
3030
31 float %test6(float %F) {
32 %X = bitcast float %F to float
33 %Y = add float %X, 2.0
34 %Z = bitcast float %Y to int
35 %res = bitcast int %Z to float
36 ret float %res
31 define float @test6(float %F) {
32 %X = bitcast float %F to float ; [#uses=1]
33 %Y = add float %X, 2.000000e+00 ; [#uses=1]
34 %Z = bitcast float %Y to i32 ; [#uses=1]
35 %res = bitcast i32 %Z to float ; [#uses=1]
36 ret float %res
3737 }
3838
39 int %main(int %argc, sbyte** %argv) {
40 %a = call int %test1(float 0x400921FB40000000)
41 %b = call float %test2(int %a)
42 %c = call long %test3(double 0x400921FB4D12D84A)
43 %d = call double %test4(long %c)
44 %e = call double %test5(double 7.0)
45 %f = call float %test6(float 7.0)
46 ret int %a
39 define i32 @main(i32 %argc, i8** %argv) {
40 %a = call i32 @test1( float 0x400921FB40000000 ) ; [#uses=2]
41 %b = call float @test2( i32 %a ) ; [#uses=0]
42 %c = call i64 @test3( double 0x400921FB4D12D84A ) ; [#uses=1]
43 %d = call double @test4( i64 %c ) ; [#uses=0]
44 %e = call double @test5( double 7.000000e+00 ) ; [#uses=0]
45 %f = call float @test6( float 7.000000e+00 ) ; [#uses=0]
46 ret i32 %a
4747 }
48
None ; RUN: llvm-upgrade < %s | llvm-as -o - | llc
0 ; RUN: llvm-as < %s -o - | llc
11
22 ; This caused the backend to assert out with:
33 ; SparcInstrInfo.cpp:103: failed assertion `0 && "Unexpected unsigned type"'
44 ;
5 implementation
65
7 declare void "bar"(sbyte* %G)
6 declare void @bar(i8*)
87
9 void "foo"()
10 begin
11 %cast225 = cast ulong 123456 to sbyte* ; [#uses=1]
12 call void %bar( sbyte* %cast225)
13 ret void
14 end
8 define void @foo() {
9 %cast225 = inttoptr i64 123456 to i8* ; [#uses=1]
10 call void @bar( i8* %cast225 )
11 ret void
12 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ; Compiling this file produces:
33 ; Sparc.cpp:91: failed assertion `(offset - OFFSET) % getStackFrameSizeAlignment() == 0'
44 ;
5 implementation
5 declare i32 @SIM(i8*, i8*, i32, i32, i32, [256 x i32]*, i32, i32, i32)
66
7 declare int "SIM"(sbyte* %A, sbyte* %B, int %M, int %N, int %K, [256 x int]* %V, int %Q, int %R, int %nseq)
7 define void @foo() {
8 bb0:
9 %V = alloca [256 x i32], i32 256 ; <[256 x i32]*> [#uses=1]
10 call i32 @SIM( i8* null, i8* null, i32 0, i32 0, i32 0, [256 x i32]* %V, i32 0, i32 0, i32 2 ) ; :0 [#uses=0]
11 ret void
12 }
813
9 void "foo"()
10 begin
11 bb0: ;[#uses=0]
12 %V = alloca [256 x int], uint 256 ; <[256 x int]*> [#uses=1]
13 call int %SIM( sbyte* null, sbyte* null, int 0, int 0, int 0, [256 x int]* %V, int 0, int 0, int 2 ) ; :0 [#uses=0]
14 ret void
15 end
16
17
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 void %QRiterate(int %p.1, double %tmp.212) {
3 entry: ; No predecessors!
4 %tmp.184 = setgt int %p.1, 0 ; [#uses=1]
5 br bool %tmp.184, label %shortcirc_next.1, label %shortcirc_done.1
2 define void @QRiterate(i32 %p.1, double %tmp.212) {
3 entry:
4 %tmp.184 = icmp sgt i32 %p.1, 0 ; [#uses=1]
5 br i1 %tmp.184, label %shortcirc_next.1, label %shortcirc_done.1
66
7 shortcirc_next.1: ; preds = %entry
8 %tmp.213 = setne double %tmp.212, 0.000000e+00
7 shortcirc_next.1: ; preds = %shortcirc_done.1, %entry
8 %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; [#uses=1]
99 br label %shortcirc_done.1
1010
11 shortcirc_done.1: ; preds = %entry, %shortcirc_next.1
12 %val.1 = phi bool [ false, %entry ], [ %tmp.213, %shortcirc_next.1 ]
13 br bool %val.1, label %shortcirc_next.1, label %exit.1
11 shortcirc_done.1: ; preds = %shortcirc_next.1, %entry
12 %val.1 = phi i1 [ false, %entry ], [ %tmp.213, %shortcirc_next.1 ] ; [#uses=1]
13 br i1 %val.1, label %shortcirc_next.1, label %exit.1
1414
15 exit.1:
16 ret void
15 exit.1: ; preds = %shortcirc_done.1
16 ret void
1717 }
18
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2
3 void %QRiterate(double %tmp.212) {
4 %tmp.213 = setne double %tmp.212, 0.000000e+00
2 define void @QRiterate(double %tmp.212) {
3 %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; [#uses=1]
54 br label %shortcirc_next.1
65
7 shortcirc_next.1: ; preds = %entry
8 br bool %tmp.213, label %shortcirc_next.1, label %exit.1
6 shortcirc_next.1: ; preds = %shortcirc_next.1, %0
7 br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
98
10 exit.1:
11 ret void
9 exit.1: ; preds = %shortcirc_next.1
10 ret void
1211 }
12
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 void %QRiterate(double %tmp.212) {
3 entry: ; No predecessors!
2 define void @QRiterate(double %tmp.212) {
3 entry:
44 br label %shortcirc_next.1
55
6 shortcirc_next.1: ; preds = %entry
7 %tmp.213 = setne double %tmp.212, 0.000000e+00
8 br bool %tmp.213, label %shortcirc_next.1, label %exit.1
6 shortcirc_next.1: ; preds = %shortcirc_next.1, %entry
7 %tmp.213 = fcmp une double %tmp.212, 0.000000e+00 ; [#uses=1]
8 br i1 %tmp.213, label %shortcirc_next.1, label %exit.1
99
10 exit.1:
11 ret void
10 exit.1: ; preds = %shortcirc_next.1
11 ret void
1212 }
13
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: May 28, 2003.
33 ;; From: test/Programs/External/SPEC/CINT2000/175.vpr.llvm.bc
44 ;; Function: int %main(int %argc.1, sbyte** %argv.1)
55 ;;
66 ;; Error: A function call with about 56 arguments causes an assertion failure
7 ;; in llc because the register allocator cannot find a register
8 ;; not used explicitly by the call instruction.
9 ;;
7 ;; in llc because the register allocator cannot find a register
8 ;; not used explicitly by the call instruction.
9 ;;
1010 ;; Cause: Regalloc was not keeping track of free registers correctly.
11 ;; It was counting the registers allocated to all outgoing arguments,
12 ;; even though most of those are copied to the stack (so those
13 ;; registers are not actually used by the call instruction).
11 ;; It was counting the registers allocated to all outgoing arguments,
12 ;; even though most of those are copied to the stack (so those
13 ;; registers are not actually used by the call instruction).
1414 ;;
1515 ;; Fixed: By rewriting selection and allocation so that selection explicitly
16 ;; inserts all copy operations required for passing arguments and
16 ;; inserts all copy operations required for passing arguments and
1717 ;; for the return value of a call, copying to/from registers
1818 ;; and/or to stack locations as needed.
1919 ;;
20 %struct..s_annealing_sched = type { i32, float, float, float, float }
21 %struct..s_chan = type { i32, float, float, float, float }
22 %struct..s_det_routing_arch = type { i32, float, float, float, i32, i32, i16, i16, i16, float, float }
23 %struct..s_placer_opts = type { i32, float, i32, i32, i8*, i32, i32 }
24 %struct..s_router_opts = type { float, float, float, float, float, i32, i32, i32, i32 }
25 %struct..s_segment_inf = type { float, i32, i16, i16, float, float, i32, float, float }
26 %struct..s_switch_inf = type { i32, float, float, float, float }
2027
21 %struct..s_annealing_sched = type { uint, float, float, float, float }
22 %struct..s_chan = type { uint, float, float, float, float }
23 %struct..s_det_routing_arch = type { uint, float, float, float, uint, int, short, short, short, float, float }
24 %struct..s_placer_opts = type { int, float, int, uint, sbyte*, uint, int }
25 %struct..s_router_opts = type { float, float, float, float, float, int, int, uint, int }
26 %struct..s_segment_inf = type { float, int, short, short, float, float, uint, float, float }
27 %struct..s_switch_inf = type { uint, float, float, float, float }
28 define i32 @main(i32 %argc.1, i8** %argv.1) {
29 entry:
30 %net_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
31 %place_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
32 %arch_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
33 %route_file = alloca [300 x i8] ; <[300 x i8]*> [#uses=1]
34 %full_stats = alloca i32 ; [#uses=1]
35 %operation = alloca i32 ; [#uses=1]
36 %verify_binary_search = alloca i32 ; [#uses=1]
37 %show_graphics = alloca i32 ; [#uses=1]
38 %annealing_sched = alloca %struct..s_annealing_sched ; <%struct..s_annealing_sched*> [#uses=5]
39 %placer_opts = alloca %struct..s_placer_opts ; <%struct..s_placer_opts*> [#uses=7]
40 %router_opts = alloca %struct..s_router_opts ; <%struct..s_router_opts*> [#uses=9]
41 %det_routing_arch = alloca %struct..s_det_routing_arch ; <%struct..s_det_routing_arch*> [#uses=11]
42 %segment_inf = alloca %struct..s_segment_inf* ; <%struct..s_segment_inf**> [#uses=1]
43 %timing_inf = alloca { i32, float, float, float, float, float, float, float, float, float, float } ; <{ i32, float, float, float, float, float, float, float, float, float, float }*> [#uses=11]
44 %tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 4 ; [#uses=1]
45 %tmp.105 = getelementptr [300 x i8]* %net_file, i64 0, i64 0 ; [#uses=1]
46 %tmp.106 = getelementptr [300 x i8]* %arch_file, i64 0, i64 0 ; [#uses=1]
47 %tmp.107 = getelementptr [300 x i8]* %place_file, i64 0, i64 0 ; [#uses=1]
48 %tmp.108 = getelementptr [300 x i8]* %route_file, i64 0, i64 0 ; [#uses=1]
49 %tmp.109 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 0 ; [#uses=1]
50 %tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 0 ; [#uses=1]
51 %tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 6 ; [#uses=1]
52 %tmp.118 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 7 ; [#uses=1]
53 %tmp.135 = load i32* %operation ; [#uses=1]
54 %tmp.137 = load i32* %tmp.112 ; [#uses=1]
55 %tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 1 ; [#uses=1]
56 %tmp.139 = load float* %tmp.138 ; [#uses=1]
57 %tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 2 ; [#uses=1]
58 %tmp.141 = load i32* %tmp.140 ; [#uses=1]
59 %tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 3 ; [#uses=1]
60 %tmp.143 = load i32* %tmp.142 ; [#uses=1]
61 %tmp.145 = load i8** %tmp.101 ; [#uses=1]
62 %tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, i64 0, i32 5 ; [#uses=1]
63 %tmp.147 = load i32* %tmp.146 ; [#uses=1]
64 %tmp.149 = load i32* %tmp.114 ; [#uses=1]
65 %tmp.154 = load i32* %full_stats ; [#uses=1]
66 %tmp.155 = load i32* %verify_binary_search ; [#uses=1]
67 %tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 0 ; [#uses=1]
68 %tmp.157 = load i32* %tmp.156 ; [#uses=1]
69 %tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 1 ; [#uses=1]
70 %tmp.159 = load float* %tmp.158 ; [#uses=1]
71 %tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 2 ; [#uses=1]
72 %tmp.161 = load float* %tmp.160 ; [#uses=1]
73 %tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 3 ; [#uses=1]
74 %tmp.163 = load float* %tmp.162 ; [#uses=1]
75 %tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, i64 0, i32 4 ; [#uses=1]
76 %tmp.165 = load float* %tmp.164 ; [#uses=1]
77 %tmp.166 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 0 ; [#uses=1]
78 %tmp.167 = load float* %tmp.166 ; [#uses=1]
79 %tmp.168 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 1 ; [#uses=1]
80 %tmp.169 = load float* %tmp.168 ; [#uses=1]
81 %tmp.170 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 2 ; [#uses=1]
82 %tmp.171 = load float* %tmp.170 ; [#uses=1]
83 %tmp.172 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 3 ; [#uses=1]
84 %tmp.173 = load float* %tmp.172 ; [#uses=1]
85 %tmp.174 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 4 ; [#uses=1]
86 %tmp.175 = load float* %tmp.174 ; [#uses=1]
87 %tmp.176 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 5 ; [#uses=1]
88 %tmp.177 = load i32* %tmp.176 ; [#uses=1]
89 %tmp.178 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 6 ; [#uses=1]
90 %tmp.179 = load i32* %tmp.178 ; [#uses=1]
91 %tmp.181 = load i32* %tmp.118 ; [#uses=1]
92 %tmp.182 = getelementptr %struct..s_router_opts* %router_opts, i64 0, i32 8 ; [#uses=1]
93 %tmp.183 = load i32* %tmp.182 ; [#uses=1]
94 %tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 0 ; [#uses=1]
95 %tmp.185 = load i32* %tmp.184 ; [#uses=1]
96 %tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 1 ; [#uses=1]
97 %tmp.187 = load float* %tmp.186 ; [#uses=1]
98 %tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 2 ; [#uses=1]
99 %tmp.189 = load float* %tmp.188 ; [#uses=1]
100 %tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 3 ; [#uses=1]
101 %tmp.191 = load float* %tmp.190 ; [#uses=1]
102 %tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 4 ; [#uses=1]
103 %tmp.193 = load i32* %tmp.192 ; [#uses=1]
104 %tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 5 ; [#uses=1]
105 %tmp.195 = load i32* %tmp.194 ; [#uses=1]
106 %tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 6 ; [#uses=1]
107 %tmp.197 = load i16* %tmp.196 ; [#uses=1]
108 %tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 7 ; [#uses=1]
109 %tmp.199 = load i16* %tmp.198 ; [#uses=1]
110 %tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 8 ; [#uses=1]
111 %tmp.201 = load i16* %tmp.200 ; [#uses=1]
112 %tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 9 ; [#uses=1]
113 %tmp.203 = load float* %tmp.202 ; [#uses=1]
114 %tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, i64 0, i32 10 ; [#uses=1]
115 %tmp.205 = load float* %tmp.204 ; [#uses=1]
116 %tmp.206 = load %struct..s_segment_inf** %segment_inf ; <%struct..s_segment_inf*> [#uses=1]
117 %tmp.208 = load i32* %tmp.109 ; [#uses=1]
118 %tmp.209 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 1 ; [#uses=1]
119 %tmp.210 = load float* %tmp.209 ; [#uses=1]
120 %tmp.211 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 2 ; [#uses=1]
121 %tmp.212 = load float* %tmp.211 ; [#uses=1]
122 %tmp.213 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 3 ; [#uses=1]
123 %tmp.214 = load float* %tmp.213 ; [#uses=1]
124 %tmp.215 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 4 ; [#uses=1]
125 %tmp.216 = load float* %tmp.215 ; [#uses=1]
126 %tmp.217 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 5 ; [#uses=1]
127 %tmp.218 = load float* %tmp.217 ; [#uses=1]
128 %tmp.219 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 6 ; [#uses=1]
129 %tmp.220 = load float* %tmp.219 ; [#uses=1]
130 %tmp.221 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 7 ; [#uses=1]
131 %tmp.222 = load float* %tmp.221 ; [#uses=1]
132 %tmp.223 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 8 ; [#uses=1]
133 %tmp.224 = load float* %tmp.223 ; [#uses=1]
134 %tmp.225 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 9 ; [#uses=1]
135 %tmp.226 = load float* %tmp.225 ; [#uses=1]
136 %tmp.227 = getelementptr { i32, float, float, float, float, float, float, float, float, float, float }* %timing_inf, i64 0, i32 10 ; [#uses=1]
137 %tmp.228 = load float* %tmp.227 ; [#uses=1]
138 call void @place_and_route( i32 %tmp.135, i32 %tmp.137, float %tmp.139, i32 %tmp.141, i32 %tmp.143, i8* %tmp.145, i32 %tmp.147, i32 %tmp.149, i8* %tmp.107, i8* %tmp.105, i8* %tmp.106, i8* %tmp.108, i32 %tmp.154, i32 %tmp.155, i32 %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, i32 %tmp.177, i32 %tmp.179, i32 %tmp.181, i32 %tmp.183, i32 %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, i32 %tmp.193, i32 %tmp.195, i16 %tmp.197, i16 %tmp.199, i16 %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, i32 %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
139 %tmp.231 = load i32* %show_graphics ; [#uses=1]
140 %tmp.232 = icmp ne i32 %tmp.231, 0 ; [#uses=1]
141 br i1 %tmp.232, label %then.2, label %endif.2
28142
29 implementation
30
31 int %main(int %argc.1, sbyte** %argv.1) {
32 entry:
33 %net_file = alloca [300 x sbyte]
34 %place_file = alloca [300 x sbyte]
35 %arch_file = alloca [300 x sbyte]
36 %route_file = alloca [300 x sbyte]
37 %full_stats = alloca uint
38 %operation = alloca int
39 %verify_binary_search = alloca uint
40 %show_graphics = alloca uint
41 %annealing_sched = alloca %struct..s_annealing_sched
42 %placer_opts = alloca %struct..s_placer_opts
43 %router_opts = alloca %struct..s_router_opts
44 %det_routing_arch = alloca %struct..s_det_routing_arch
45 %segment_inf = alloca %struct..s_segment_inf*
46 %timing_inf = alloca { uint, float, float, float, float, float, float, float, float, float, float }
47 %tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 4
48 %tmp.105 = getelementptr [300 x sbyte]* %net_file, long 0, long 0
49 %tmp.106 = getelementptr [300 x sbyte]* %arch_file, long 0, long 0
50 %tmp.107 = getelementptr [300 x sbyte]* %place_file, long 0, long 0
51 %tmp.108 = getelementptr [300 x sbyte]* %route_file, long 0, long 0
52 %tmp.109 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 0
53 %tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 0
54 %tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 6
55 %tmp.118 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 7
56 %tmp.135 = load int* %operation
57 %tmp.137 = load int* %tmp.112
58 %tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 1
59 %tmp.139 = load float* %tmp.138
60 %tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 2
61 %tmp.141 = load int* %tmp.140
62 %tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 3
63 %tmp.143 = load uint* %tmp.142
64 %tmp.145 = load sbyte** %tmp.101
65 %tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 5
66 %tmp.147 = load uint* %tmp.146
67 %tmp.149 = load int* %tmp.114
68 %tmp.154 = load uint* %full_stats
69 %tmp.155 = load uint* %verify_binary_search
70 %tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 0
71 %tmp.157 = load uint* %tmp.156
72 %tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 1
73 %tmp.159 = load float* %tmp.158
74 %tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 2
75 %tmp.161 = load float* %tmp.160
76 %tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 3
77 %tmp.163 = load float* %tmp.162
78 %tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 4
79 %tmp.165 = load float* %tmp.164
80 %tmp.166 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 0
81 %tmp.167 = load float* %tmp.166
82 %tmp.168 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 1
83 %tmp.169 = load float* %tmp.168
84 %tmp.170 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 2
85 %tmp.171 = load float* %tmp.170
86 %tmp.172 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 3
87 %tmp.173 = load float* %tmp.172
88 %tmp.174 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 4
89 %tmp.175 = load float* %tmp.174
90 %tmp.176 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 5
91 %tmp.177 = load int* %tmp.176
92 %tmp.178 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 6
93 %tmp.179 = load int* %tmp.178
94 %tmp.181 = load uint* %tmp.118
95 %tmp.182 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 8
96 %tmp.183 = load int* %tmp.182
97 %tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 0
98 %tmp.185 = load uint* %tmp.184
99 %tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 1
100 %tmp.187 = load float* %tmp.186
101 %tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 2
102 %tmp.189 = load float* %tmp.188
103 %tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 3
104 %tmp.191 = load float* %tmp.190
105 %tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 4
106 %tmp.193 = load uint* %tmp.192
107 %tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 5
108 %tmp.195 = load int* %tmp.194
109 %tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 6
110 %tmp.197 = load short* %tmp.196
111 %tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 7
112 %tmp.199 = load short* %tmp.198
113 %tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 8
114 %tmp.201 = load short* %tmp.200
115 %tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 9
116 %tmp.203 = load float* %tmp.202
117 %tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 10
118 %tmp.205 = load float* %tmp.204
119 %tmp.206 = load %struct..s_segment_inf** %segment_inf
120 %tmp.208 = load uint* %tmp.109
121 %tmp.209 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 1
122 %tmp.210 = load float* %tmp.209
123 %tmp.211 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 2
124 %tmp.212 = load float* %tmp.211
125 %tmp.213 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 3
126 %tmp.214 = load float* %tmp.213
127 %tmp.215 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 4
128 %tmp.216 = load float* %tmp.215
129 %tmp.217 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 5
130 %tmp.218 = load float* %tmp.217
131 %tmp.219 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 6
132 %tmp.220 = load float* %tmp.219
133 %tmp.221 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 7
134 %tmp.222 = load float* %tmp.221
135 %tmp.223 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 8
136 %tmp.224 = load float* %tmp.223
137 %tmp.225 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 9
138 %tmp.226 = load float* %tmp.225
139 %tmp.227 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 10
140 %tmp.228 = load float* %tmp.227
141 call void %place_and_route( int %tmp.135, int %tmp.137, float %tmp.139, int %tmp.141, uint %tmp.143, sbyte* %tmp.145, uint %tmp.147, int %tmp.149, sbyte* %tmp.107, sbyte* %tmp.105, sbyte* %tmp.106, sbyte* %tmp.108, uint %tmp.154, uint %tmp.155, uint %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, int %tmp.177, int %tmp.179, uint %tmp.181, int %tmp.183, uint %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, uint %tmp.193, int %tmp.195, short %tmp.197, short %tmp.199, short %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, uint %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
142 %tmp.231 = load uint* %show_graphics
143 %tmp.232 = setne uint %tmp.231, 0
144 br bool %tmp.232, label %then.2, label %endif.2
145
146 then.2:
143 then.2: ; preds = %entry
147144 br label %endif.2
148145
149 endif.2:
150 ret int 0
146 endif.2: ; preds = %then.2, %entry
147 ret i32 0
151148 }
152149
153 declare int %printf(sbyte*, ...)
150 declare i32 @printf(i8*, ...)
154151
155 declare void %place_and_route(int, int, float, int, uint, sbyte*, uint, int, sbyte*, sbyte*, sbyte*, sbyte*, uint, uint, uint, float, float, float, float, float, float, float, float, float, int, int, uint, int, uint, float, float, float, uint, int, short, short, short, float, float, %struct..s_segment_inf*, uint, float, float, float, float, float, float, float, float, float, float)
152 declare void @place_and_route(i32, i32, float, i32, i32, i8*, i32, i32, i8*, i8*, i8*, i8*, i32, i32, i32, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, float, float, float, i32, i32, i16, i16, i16, float, float, %struct..s_segment_inf*, i32, float, float, float, float, float, float, float, float, float, float)
None ; RUN: llvm-upgrade %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: May 28, 2003.
33 ;; From: test/Programs/External/SPEC/CINT2000/254.gap.llvm.bc
1515 ;; The next instruction contributes a leading non-zero so another
1616 ;; zero should not be added before it!
1717 ;;
18 %FileType = type { i32, [256 x i8], i32, i32, i32, i32 }
19 @OutputFiles = external global [16 x %FileType] ; <[16 x %FileType]*> [#uses=1]
20 @Output = internal global %FileType* null ; <%FileType**> [#uses=1]
1821
22 define internal i32 @OpenOutput(i8* %filename.1) {
23 entry:
24 %tmp.0 = load %FileType** @Output ; <%FileType*> [#uses=1]
25 %tmp.4 = getelementptr %FileType* %tmp.0, i64 1 ; <%FileType*> [#uses=1]
26 %addrOfGlobal = getelementptr [16 x %FileType]* @OutputFiles, i64 0 ; <[16 x %FileType]*> [#uses=1]
27 %constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, i64 1 ; <[16 x %FileType]*> [#uses=1]
28 %constantGEP.upgrd.1 = getelementptr [16 x %FileType]* %constantGEP, i64 0, i64 0 ; <%FileType*> [#uses=1]
29 %tmp.10 = icmp eq %FileType* %tmp.4, %constantGEP.upgrd.1 ; [#uses=1]
30 br i1 %tmp.10, label %return, label %endif.0
1931
20 %FileType = type { int, [256 x sbyte], int, int, int, int }
21 %OutputFiles = uninitialized global [16 x %FileType]
22 %Output = internal global %FileType* null
32 endif.0: ; preds = %entry
33 ret i32 0
2334
35 return: ; preds = %entry
36 ret i32 1
37 }
2438
25 implementation; Functions:
26
27 internal int %OpenOutput(sbyte* %filename.1) {
28 entry:
29 %tmp.0 = load %FileType** %Output
30 %tmp.4 = getelementptr %FileType* %tmp.0, long 1
31
32 ;;------ Original instruction in 254.gap.llvm.bc:
33 ;; %tmp.10 = seteq { int, [256 x sbyte], int, int, int, int }* %tmp.4, getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* %OutputFiles, long 1), long 0, long 0)
34
35 ;;------ Code sequence produced by preselection phase for above instr:
36 ;; This code sequence is folded incorrectly by llc during selection
37 ;; causing an assertion about a dynamic casting error.
38 %addrOfGlobal = getelementptr [16 x %FileType]* %OutputFiles, long 0
39 %constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, long 1
40 %constantGEP = getelementptr [16 x %FileType]* %constantGEP, long 0, long 0
41 %tmp.10 = seteq %FileType* %tmp.4, %constantGEP
42 br bool %tmp.10, label %return, label %endif.0
43
44 endif.0:
45 ret int 0
46
47 return:
48 ret int 1
49 }
None ; RUN: llvm-upgrade %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: May 28, 2003.
33 ;; From: test/Programs/SingleSource/richards_benchmark.c
88 ;; causes llc to produces an invalid register
99 ;; for the phi arguments.
1010
11 %struct..packet = type { %struct..packet*, int, int, int, [4 x sbyte] }
12 %struct..task = type { %struct..task*, int, int, %struct..packet*, int, %struct..task* (%struct..packet*)*, int, int }
13 %v1 = external global int
14 %v2 = external global int
11 %struct..packet = type { %struct..packet*, i32, i32, i32, [4 x i8] }
12 %struct..task = type { %struct..task*, i32, i32, %struct..packet*, i32, %struct..task* (%struct..packet*)*, i32, i32 }
13 @v1 = external global i32 ; [#uses=1]
14 @v2 = external global i32 ; [#uses=1]
1515
16 implementation ; Functions:
16 define %struct..task* @handlerfn(%struct..packet* %pkt.2) {
17 entry:
18 %tmp.1 = icmp ne %struct..packet* %pkt.2, null ; [#uses=1]
19 br i1 %tmp.1, label %cond_false, label %cond_continue
1720
18 %struct..task* %handlerfn(%struct..packet* %pkt.2) {
19 entry: ; No predecessors!
20 %tmp.1 = setne %struct..packet* %pkt.2, null
21 br bool %tmp.1, label %cond_false, label %cond_continue
21 cond_false: ; preds = %entry
22 br label %cond_continue
2223
23 cond_false: ; preds = %entry
24 br label %cond_continue
25
26 cond_continue: ; preds = %entry, %cond_false
27 %mem_tmp.0 = phi int* [ %v2, %cond_false ], [ %v1, %entry ]
28 %tmp.12 = cast int* %mem_tmp.0 to %struct..packet*
29 call void %append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
30 ret %struct..task* null
24 cond_continue: ; preds = %cond_false, %entry
25 %mem_tmp.0 = phi i32* [ @v2, %cond_false ], [ @v1, %entry ] ; [#uses=1]
26 %tmp.12 = bitcast i32* %mem_tmp.0 to %struct..packet* ; <%struct..packet*> [#uses=1]
27 call void @append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
28 ret %struct..task* null
3129 }
3230
33 declare void %append(%struct..packet*, %struct..packet*)
31 declare void @append(%struct..packet*, %struct..packet*)
32
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: May 28, 2003.
33 ;; From: test/Programs/MultiSource/Olden-perimeter/maketree.c
1111 ;; is wrong because the value being compared (int euclid = x*x + y*y)
1212 ;; overflows, so that the 64-bit and 32-bit compares are not equal.
1313
14 %.str_1 = internal constant [6 x sbyte] c"true\0A\00"
15 %.str_2 = internal constant [7 x sbyte] c"false\0A\00"
14 @.str_1 = internal constant [6 x i8] c"true\0A\00" ; <[6 x i8]*> [#uses=1]
15 @.str_2 = internal constant [7 x i8] c"false\0A\00" ; <[7 x i8]*> [#uses=1]
1616
17 implementation ; Functions:
17 declare i32 @printf(i8*, ...)
1818
19 declare int %printf(sbyte*, ...)
20
21 internal void %__main() {
22 entry: ; No predecessors!
23 ret void
19 define internal void @__main() {
20 entry:
21 ret void
2422 }
2523
26 internal void %CheckOutside(int %x.1, int %y.1) {
27 entry: ; No predecessors!
28 %tmp.2 = mul int %x.1, %x.1 ; [#uses=1]
29 %tmp.5 = mul int %y.1, %y.1 ; [#uses=1]
30 %tmp.6 = add int %tmp.2, %tmp.5 ; [#uses=1]
31 %tmp.8 = setle int %tmp.6, 4194304 ; [#uses=1]
32 br bool %tmp.8, label %then, label %else
24 define internal void @CheckOutside(i32 %x.1, i32 %y.1) {
25 entry:
26 %tmp.2 = mul i32 %x.1, %x.1 ; [#uses=1]
27 %tmp.5 = mul i32 %y.1, %y.1 ; [#uses=1]
28 %tmp.6 = add i32 %tmp.2, %tmp.5 ; [#uses=1]
29 %tmp.8 = icmp sle i32 %tmp.6, 4194304 ; [#uses=1]
30 br i1 %tmp.8, label %then, label %else
3331
34 then: ; preds = %entry
35 %tmp.11 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([6 x sbyte]* %.str_1, long 0, long 0) ) ; [#uses=0]
36 br label %UnifiedExitNode
32 then: ; preds = %entry
33 %tmp.11 = call i32 (i8*, ...)* @printf( i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 0) ) ; [#uses=0]
34 br label %UnifiedExitNode
3735
38 else: ; preds = %entry
39 %tmp.13 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_2, long 0, long 0) ) ; [#uses=0]
40 br label %UnifiedExitNode
36 else: ; preds = %entry
37 %tmp.13 = call i32 (i8*, ...)* @printf( i8* getelementptr ([7 x i8]* @.str_2, i64 0, i64 0) ) ; [#uses=0]
38 br label %UnifiedExitNode
4139
42 UnifiedExitNode: ; preds = %then, %else
43 ret void
40 UnifiedExitNode: ; preds = %else, %then
41 ret void
4442 }
4543
46 int %main() {
47 entry: ; No predecessors!
48 call void %__main( )
49 call void %CheckOutside( int 2097152, int 2097152 )
50 ret int 0
44 define i32 @main() {
45 entry:
46 call void @__main( )
47 call void @CheckOutside( i32 2097152, i32 2097152 )
48 ret i32 0
5149 }
50
None ; RUN: llvm-upgrade %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 @.str_1 = internal constant [42 x i8] c" ui = %u (0x%x)\09\09UL-ui = %lld (0x%llx)\0A\00" ; <[42 x i8]*> [#uses=1]
23
3 %.str_1 = internal constant [42 x sbyte] c" ui = %u (0x%x)\09\09UL-ui = %lld (0x%llx)\0A\00"
4 declare i32 @printf(i8*, ...)
45
5 implementation ; Functions:
6
7 declare int %printf(sbyte*, ...)
8
9 internal ulong %getL() {
10 entry: ; No predecessors!
11 ret ulong 12659530247033960611
6 define internal i64 @getL() {
7 entry:
8 ret i64 -5787213826675591005
129 }
1310
14 int %main(int %argc.1, sbyte** %argv.1) {
15 entry: ; No predecessors!
16 %tmp.11 = call ulong %getL( )
17 %tmp.5 = cast ulong %tmp.11 to uint
18 %tmp.23 = and ulong %tmp.11, 18446744069414584320
19 %tmp.16 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([42 x sbyte]* %.str_1, long 0, long 0), uint %tmp.5, uint %tmp.5, ulong %tmp.23, ulong %tmp.23 )
20 ret int 0
11 define i32 @main(i32 %argc.1, i8** %argv.1) {
12 entry:
13 %tmp.11 = call i64 @getL( ) ; [#uses=2]
14 %tmp.5 = trunc i64 %tmp.11 to i32 ; [#uses=2]
15 %tmp.23 = and i64 %tmp.11, -4294967296 ; [#uses=2]
16 %tmp.16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([42 x i8]* @.str_1, i64 0, i64 0), i32 %tmp.5, i32 %tmp.5, i64 %tmp.23, i64 %tmp.23 ) ; [#uses=0]
17 ret i32 0
2118 }
19
None ; RUN: llvm-upgrade %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: Jul 8, 2003.
33 ;; From: test/Programs/MultiSource/Olden-perimeter
1010 ;; for bitwise operations but not booleans! For booleans,
1111 ;; the result has to be compared with 0.
1212
13 %.str_1 = internal constant [30 x sbyte] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
13 @.str_1 = internal constant [30 x i8] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
1414
15 declare i32 @printf(i8*, ...)
1516
16 implementation ; Functions:
17
18 declare int %printf(sbyte*, ...)
19
20 int %adj(uint %d.1, uint %ct.1) {
17 define i32 @adj(i32 %d.1, i32 %ct.1) {
2118 entry:
22 %tmp.19 = seteq uint %ct.1, 2
23 %tmp.22.not = cast uint %ct.1 to bool
24 %tmp.221 = xor bool %tmp.22.not, true
25 %tmp.26 = or bool %tmp.19, %tmp.221
26 %tmp.27 = cast bool %tmp.26 to int
27 ret int %tmp.27
19 %tmp.19 = icmp eq i32 %ct.1, 2 ; [#uses=1]
20 %tmp.22.not = trunc i32 %ct.1 to i1 ; [#uses=1]
21 %tmp.221 = xor i1 %tmp.22.not, true ; [#uses=1]
22 %tmp.26 = or i1 %tmp.19, %tmp.221 ; [#uses=1]
23 %tmp.27 = zext i1 %tmp.26 to i32 ; [#uses=1]
24 ret i32 %tmp.27
2825 }
2926
30 int %main() {
27 define i32 @main() {
3128 entry:
32 %result = call int %adj(uint 3, uint 2)
33 %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([30 x sbyte]* %.str_1, long 0, long 0), uint 3, uint 2, int %result)
34 ret int 0
29 %result = call i32 @adj( i32 3, i32 2 ) ; [#uses=1]
30 %tmp.0 = call i32 (i8*, ...)* @printf( i8* getelementptr ([30 x i8]* @.str_1, i64 0, i64 0), i32 3, i32 2, i32 %result ) ; [#uses=0]
31 ret i32 0
3532 }
33
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
22 ;; Date: Jul 29, 2003.
33 ;; From: test/Programs/MultiSource/Ptrdist-bc
1313 ;; .ascii "\000\001\001\001\001\001\001\001\001\002\003\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\002\004\005\001\001\006\a\001\b\t\n\v\f\r\016\017\020\020\020\020\020\020\020\020\020\020\001\021\022\023\024\001\001\025\025\025\025\025\025\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\026\027\030\031\032\001\033\034\035\036\037 !\"#$%&'()*+,-./$0$1$234\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001"
1414 ;;
1515
16 @yy_ec = internal constant [6 x i8] c"\06\07\01\08\01\09" ; <[6 x i8]*> [#uses=1]
17 @.str_3 = internal constant [8 x i8] c"[%d] = \00" ; <[8 x i8]*> [#uses=1]
18 @.str_4 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
1619
17 %yy_ec = internal constant [6 x sbyte] c"\06\07\01\08\01\09"
20 declare i32 @printf(i8*, ...)
1821
19 %.str_3 = internal constant [8 x sbyte] c"[%d] = \00"
20 %.str_4 = internal constant [4 x sbyte] c"%d\0A\00"
22 define i32 @main() {
23 entry:
24 br label %loopentry
2125
22 implementation
26 loopentry: ; preds = %loopentry, %entry
27 %i = phi i64 [ 0, %entry ], [ %inc.i, %loopentry ] ; [#uses=3]
28 %cptr = getelementptr [6 x i8]* @yy_ec, i64 0, i64 %i ; [#uses=1]
29 %c = load i8* %cptr ; [#uses=1]
30 %ignore = call i32 (i8*, ...)* @printf( i8* getelementptr ([8 x i8]* @.str_3, i64 0, i64 0), i64 %i ) ; [#uses=0]
31 %ignore2 = call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str_4, i64 0, i64 0), i8 %c ) ; [#uses=0]
32 %inc.i = add i64 %i, 1 ; [#uses=2]
33 %done = icmp sle i64 %inc.i, 5 ; [#uses=1]
34 br i1 %done, label %loopentry, label %exit.1
2335
24 declare int %printf(sbyte*, ...)
36 exit.1: ; preds = %loopentry
37 ret i32 0
38 }
2539
26 int %main() {
27 entry:
28 br label %loopentry
29 loopentry:
30 %i = phi long [0, %entry], [%inc.i, %loopentry]
31 %cptr = getelementptr [6 x sbyte]* %yy_ec, long 0, long %i
32 %c = load sbyte* %cptr
33 %ignore = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([8 x sbyte]* %.str_3, long 0, long 0), long %i)
34 %ignore2 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %.str_4, long 0, long 0), sbyte %c)
35 %inc.i = add long %i, 1
36 %done = setle long %inc.i, 5
37 br bool %done, label %loopentry, label %exit.1
38 exit.1:
39 ret int 0
40 };
None ; RUN: llvm-upgrade < %s | llvm-as | llc -enable-correct-eh-support
0 ; RUN: llvm-as < %s | llc -enable-correct-eh-support
11
2 int %test() {
3 unwind
2 define i32 @test() {
3 unwind
44 }
55
6 int %main() {
7 %X = invoke int %test() to label %cont except label %EH
8 cont:
9 ret int 1
10 EH:
11 ret int 0
6 define i32 @main() {
7 %X = invoke i32 @test( )
8 to label %cont unwind label %EH ; [#uses=0]
9
10 cont: ; preds = %0
11 ret i32 1
12
13 EH: ; preds = %0
14 ret i32 0
1215 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
1 @global_long_1 = linkonce global i64 7 ; [#uses=1]
2 @global_long_2 = linkonce global i64 49 ; [#uses=1]
13
2 %global_long_1 = linkonce global long 7
3 %global_long_2 = linkonce global long 49
4 define i32 @main() {
5 %l1 = load i64* @global_long_1 ; [#uses=1]
6 %l2 = load i64* @global_long_2 ; [#uses=1]
7 %cond = icmp sle i64 %l1, %l2 ; [#uses=1]
8 %cast2 = zext i1 %cond to i32 ; [#uses=1]
9 %RV = sub i32 1, %cast2 ; [#uses=1]
10 ret i32 %RV
11 }
412
5 implementation ; Functions:
6
7 int %main() {
8 %l1 = load long* %global_long_1
9 %l2 = load long* %global_long_2
10 %cond = setle long %l1, %l2
11 %cast2 = cast bool %cond to int
12 %RV = sub int 1, %cast2
13 ret int %RV
14 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 void %intersect_pixel() {
2 define void @intersect_pixel() {
33 entry:
4 %tmp125 = call bool %llvm.isunordered.f64( double 0.000000e+00, double 0.000000e+00 ) ; [#uses=1]
5 %tmp126 = or bool %tmp125, false ; [#uses=1]
6 %tmp126.not = xor bool %tmp126, true ; [#uses=1]
7 %brmerge1 = or bool %tmp126.not, false ; [#uses=1]
8 br bool %brmerge1, label %bb154, label %cond_false133
4 %tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; [#uses=1]
5 %tmp126 = or i1 %tmp125, false ; [#uses=1]
6 %tmp126.not = xor i1 %tmp126, true ; [#uses=1]
7 %brmerge1 = or i1 %tmp126.not, false ; [#uses=1]
8 br i1 %brmerge1, label %bb154, label %cond_false133
99
10 cond_false133: ; preds = %entry
11 ret void
10 cond_false133: ; preds = %entry
11 ret void
1212
13 bb154: ; preds = %entry
14 %tmp164 = seteq uint 0, 0 ; [#uses=0]
15 ret void
13 bb154: ; preds = %entry
14 %tmp164 = icmp eq i32 0, 0 ; [#uses=0]
15 ret void
1616 }
1717
18 declare bool %llvm.isunordered.f64(double, double)
18 declare i1 @llvm.isunordered.f64(double, double)
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc
1 %struct.TypHeader = type { uint, %struct.TypHeader**, [3 x sbyte], ubyte }
2 %.str_67 = external global [4 x sbyte] ; <[4 x sbyte]*> [#uses=1]
3 %.str_87 = external global [17 x sbyte] ; <[17 x sbyte]*> [#uses=1]
0 ; RUN: llvm-as < %s | llc
1 %struct.TypHeader = type { i32, %struct.TypHeader**, [3 x i8], i8 }
2 @.str_67 = external global [4 x i8] ; <[4 x i8]*> [#uses=1]
3 @.str_87 = external global [17 x i8] ; <[17 x i8]*> [#uses=1]
44
5 implementation ; Functions:
5 define void @PrBinop() {
6 entry:
7 br i1 false, label %cond_true, label %else.0
68
7 void %PrBinop() {
8 entry:
9 br bool false, label %cond_true, label %else.0
9 cond_true: ; preds = %entry
10 br label %else.0
1011
11 cond_true: ; preds = %entry
12 br label %else.0
13
14 else.0:
15 %tmp.167.1 = phi int [ cast ([17 x sbyte]* %.str_87 to int), %entry ], [ 0, %cond_true ]
16 call void %Pr( sbyte* getelementptr ([4 x sbyte]* %.str_67, int 0, int 0), int 0, int 0 )
17 ret void
12 else.0: ; preds = %cond_true, %entry
13 %tmp.167.1 = phi i32 [ ptrtoint ([17 x i8]* @.str_87 to i32), %entry ], [ 0, %cond_true ] ; [#uses=0]
14 call void @Pr( i8* getelementptr ([4 x i8]* @.str_67, i32 0, i32 0), i32 0, i32 0 )
15 ret void
1816 }
1917
20 declare void %Pr(sbyte*, int, int)
18 declare void @Pr(i8*, i32, i32)
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11 ; Test that llvm.memcpy works with a i64 length operand on all targets.
22
3 declare void @llvm.memcpy.i64(i8*, i8*, i64, i32)
34
4 declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
5 define void @l12_l94_bc_divide_endif_2E_3_2E_ce() {
6 newFuncRoot:
7 tail call void @llvm.memcpy.i64( i8* null, i8* null, i64 0, i32 1 )
8 unreachable
9 }
510
6 void %l12_l94_bc_divide_endif_2E_3_2E_ce() {
7 newFuncRoot:
8 tail call void %llvm.memcpy.i64( sbyte* null, sbyte* null, ulong 0, uint 1 )
9 unreachable
10 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 void %test() {
3 %X = alloca {}
4 ret void
2 define void @test() {
3 %X = alloca { } ; <{ }*> [#uses=0]
4 ret void
55 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
1 float %t(long %u_arg) {
2 %u = cast long %u_arg to ulong ; [#uses=1]
3 %tmp5 = add ulong %u, 9007199254740991 ; [#uses=1]
4 %tmp = setgt ulong %tmp5, 18014398509481982 ; [#uses=1]
5 br bool %tmp, label %T, label %F
6 T:
7 ret float 1.0
8 F:
9 call float %t(long 0)
10 ret float 0.0
0 ; RUN: llvm-as < %s | llc
1
2 define float @t(i64 %u_arg) {
3 %u = bitcast i64 %u_arg to i64 ; [#uses=1]
4 %tmp5 = add i64 %u, 9007199254740991 ; [#uses=1]
5 %tmp = icmp ugt i64 %tmp5, 18014398509481982 ; [#uses=1]
6 br i1 %tmp, label %T, label %F
7
8 T: ; preds = %0
9 ret float 1.000000e+00
10
11 F: ; preds = %0
12 call float @t( i64 0 ) ; :1 [#uses=0]
13 ret float 0.000000e+00
1114 }
15
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
1 @str = external global [36 x i8] ; <[36 x i8]*> [#uses=0]
2 @str.upgrd.1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
3 @str1 = external global [29 x i8] ; <[29 x i8]*> [#uses=0]
4 @str2 = external global [29 x i8] ; <[29 x i8]*> [#uses=1]
5 @str.upgrd.2 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
6 @str3 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
7 @str4 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
8 @str5 = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
19
2 %str = external global [36 x sbyte] ; <[36 x sbyte]*> [#uses=0]
3 %str = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=0]
4 %str1 = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=0]
5 %str2 = external global [29 x sbyte] ; <[29 x sbyte]*> [#uses=1]
6 %str = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
7 %str3 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
8 %str4 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
9 %str5 = external global [2 x sbyte] ; <[2 x sbyte]*> [#uses=0]
10
11 implementation ; Functions:
12
13 void %printArgsNoRet(int %a1, float %a2, sbyte %a3, double %a4, sbyte* %a5, int %a6, float %a7, sbyte %a8, double %a9, sbyte* %a10, int %a11, float %a12, sbyte %a13, double %a14, sbyte* %a15) {
10 define void @printArgsNoRet(i32 %a1, float %a2, i8 %a3, double %a4, i8* %a5, i32 %a6, float %a7, i8 %a8, double %a9, i8* %a10, i32 %a11, float %a12, i8 %a13, double %a14, i8* %a15) {
1411 entry:
15 %tmp17 = cast sbyte %a13 to int ; [#uses=1]
16 %tmp23 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([29 x sbyte]* %str2, int 0, uint 0), int %a11, double 0.000000e+00, int %tmp17, double %a14, int 0 ) ; [#uses=0]
12 %tmp17 = sext i8 %a13 to i32 ; [#uses=1]
13 %tmp23 = call i32 (i8*, ...)* @printf( i8* getelementptr ([29 x i8]* @str2, i32 0, i64 0), i32 %a11, double 0.000000e+00, i32 %tmp17, double %a14, i32 0 ) ; [#uses=0]
1714 ret void
1815 }
1916
20 declare int %printf(sbyte*, ...)
17 declare i32 @printf(i8*, ...)
2118
22 declare int %main(int, sbyte**)
19 declare i32 @main(i32, i8**)
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 long %test(long %A) {
3 %B = cast long %A to sbyte
4 %C = cast sbyte %B to long
5 ret long %C
2 define i64 @test(i64 %A) {
3 %B = trunc i64 %A to i8 ; [#uses=1]
4 %C = sext i8 %B to i64 ; [#uses=1]
5 ret i64 %C
66 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
1 ; ModuleID = '2006-01-12-BadSetCCFold.ll'
2 %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, i32, i32 }
13
2 %struct.node_t = type { double*, %struct.node_t*, %struct.node_t**, double**, double*, int, int }
3
4 implementation ; Functions:
5
6 void %main() {
4 define void @main() {
75 entry:
8 br bool false, label %then.2.i, label %endif.2.i
6 br i1 false, label %then.2.i, label %endif.2.i
97
108 then.2.i: ; preds = %entry
119 br label %dealwithargs.exit
1210
1311 endif.2.i: ; preds = %entry
14 br bool false, label %then.3.i, label %dealwithargs.exit
12 br i1 false, label %then.3.i, label %dealwithargs.exit
1513
1614 then.3.i: ; preds = %endif.2.i
1715 br label %dealwithargs.exit
1816
1917 dealwithargs.exit: ; preds = %then.3.i, %endif.2.i, %then.2.i
20 %n_nodes.4 = phi int [ 64, %then.3.i ], [ 64, %then.2.i ], [ 64, %endif.2.i ] ; [#uses=1]
21 %tmp.14.i1134.i.i = setgt int %n_nodes.4, 1 ; [#uses=2]
22 br bool %tmp.14.i1134.i.i, label %no_exit.i12.i.i, label %fill_table.exit22.i.i
18 %n_nodes.4 = phi i32 [ 64, %then.3.i ], [ 64, %then.2.i ], [ 64, %endif.2.i ] ; [#uses=1]
19 %tmp.14.i1134.i.i = icmp sgt i32 %n_nodes.4, 1 ; [#uses=2]
20 br i1 %tmp.14.i1134.i.i, label %no_exit.i12.i.i, label %fill_table.exit22.i.i
2321
2422 no_exit.i12.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
25 br bool false, label %fill_table.exit22.i.i, label %no_exit.i12.i.i
23 br i1 false, label %fill_table.exit22.i.i, label %no_exit.i12.i.i
2624
2725 fill_table.exit22.i.i: ; preds = %no_exit.i12.i.i, %dealwithargs.exit
2826 %cur_node.0.i8.1.i.i = phi %struct.node_t* [ undef, %dealwithargs.exit ], [ null, %no_exit.i12.i.i ] ; <%struct.node_t*> [#uses=0]
29 br bool %tmp.14.i1134.i.i, label %no_exit.i.preheader.i.i, label %make_tables.exit.i
27 br i1 %tmp.14.i1134.i.i, label %no_exit.i.preheader.i.i, label %make_tables.exit.i
3028
3129 no_exit.i.preheader.i.i: ; preds = %fill_table.exit22.i.i
3230 ret void
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11 ; This crashed the PPC backend.
22
3 void %test() {
4 %tmp125 = call bool %llvm.isunordered.f64( double 0.000000e+00, double 0.000000e+00 ) ; [#uses=1]
5 br bool %tmp125, label %bb154, label %cond_false133
3 define void @test() {
4 %tmp125 = fcmp uno double 0.000000e+00, 0.000000e+00 ; [#uses=1]
5 br i1 %tmp125, label %bb154, label %cond_false133
66
7 cond_false133: ; preds = %entry
8 ret void
7 cond_false133: ; preds = %0
8 ret void
99
10 bb154: ; preds = %entry
11 %tmp164 = seteq uint 0, 0 ; [#uses=0]
12 ret void
10 bb154: ; preds = %0
11 %tmp164 = icmp eq i32 0, 0 ; [#uses=0]
12 ret void
1313 }
1414
15 declare bool %llvm.isunordered.f64(double, double)
None ; RUN: llvm-upgrade < %s | llvm-as | llc
1 %G = external global int
0 ; RUN: llvm-as < %s | llc
1 @G = external global i32 ; [#uses=1]
22
3 void %encode_one_frame(long %tmp.2i) {
3 define void @encode_one_frame(i64 %tmp.2i) {
44 entry:
5 %tmp.9 = seteq int 0, 0 ; [#uses=1]
6 br bool %tmp.9, label %endif.0, label %shortcirc_next.0
5 %tmp.9 = icmp eq i32 0, 0 ; [#uses=1]
6 br i1 %tmp.9, label %endif.0, label %shortcirc_next.0
77
88 then.5.i: ; preds = %shortcirc_next.i
9 %tmp.114.i = div long %tmp.2i, 3 ; [#uses=1]
10 %tmp.111.i = call long %lseek( int 0, long %tmp.114.i, int 1 ) ; [#uses=0]
9 %tmp.114.i = sdiv i64 %tmp.2i, 3 ; [#uses=1]
10 %tmp.111.i = call i64 @lseek( i32 0, i64 %tmp.114.i, i32 1 ) ; [#uses=0]
1111 ret void
1212
1313 shortcirc_next.0: ; preds = %entry
1414 ret void
1515
1616 endif.0: ; preds = %entry
17 %tmp.324.i = seteq int 0, 0 ; [#uses=2]
18 %tmp.362.i = setlt int 0, 0 ; [#uses=1]
19 br bool %tmp.324.i, label %else.4.i, label %then.11.i37
17 %tmp.324.i = icmp eq i32 0, 0 ; [#uses=2]
18 %tmp.362.i = icmp slt i32 0, 0 ; [#uses=1]
19 br i1 %tmp.324.i, label %else.4.i, label %then.11.i37
2020
2121 then.11.i37: ; preds = %endif.0
2222 ret void
2323
2424 else.4.i: ; preds = %endif.0
25 br bool %tmp.362.i, label %else.5.i, label %then.12.i
25 br i1 %tmp.362.i, label %else.5.i, label %then.12.i
2626
2727 then.12.i: ; preds = %else.4.i
2828 ret void
2929
3030 else.5.i: ; preds = %else.4.i
31 br bool %tmp.324.i, label %then.0.i40, label %then.17.i
31 br i1 %tmp.324.i, label %then.0.i40, label %then.17.i
3232
3333 then.17.i: ; preds = %else.5.i
3434 ret void
3535
3636 then.0.i40: ; preds = %else.5.i
37 %tmp.8.i42 = seteq int 0, 0 ; [#uses=1]
38 br bool %tmp.8.i42, label %else.1.i56, label %then.1.i52
37 %tmp.8.i42 = icmp eq i32 0, 0 ; [#uses=1]
38 br i1 %tmp.8.i42, label %else.1.i56, label %then.1.i52
3939
4040 then.1.i52: ; preds = %then.0.i40
4141 ret void
4242
4343 else.1.i56: ; preds = %then.0.i40
44 %tmp.28.i = load int* %G
45 %tmp.29.i = seteq int %tmp.28.i, 1 ; [#uses=1]
46 br bool %tmp.29.i, label %shortcirc_next.i, label %shortcirc_done.i
44 %tmp.28.i = load i32* @G ; [#uses=1]
45 %tmp.29.i = icmp eq i32 %tmp.28.i, 1 ; [#uses=1]
46 br i1 %tmp.29.i, label %shortcirc_next.i, label %shortcirc_done.i
4747
4848 shortcirc_next.i: ; preds = %else.1.i56
49 %tmp.34.i = seteq int 0, 3 ; [#uses=1]
50 br bool %tmp.34.i, label %then.5.i, label %endif.5.i
49 %tmp.34.i = icmp eq i32 0, 3 ; [#uses=1]
50 br i1 %tmp.34.i, label %then.5.i, label %endif.5.i
5151
5252 shortcirc_done.i: ; preds = %else.1.i56
5353 ret void
5656 ret void
5757 }
5858
59 declare long %lseek(int, long, int)
59 declare i64 @lseek(i32, i64, i32)
None ; RUN: llvm-upgrade < %s | llvm-as | llc
1 ; Infinite loop in the dag combiner, reduced from 176.gcc.
0 ; RUN: llvm-as < %s | llc
1 ; Infinite loop in the dag combiner, reduced from 176.gcc.
2 %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] }
3 %struct.anon = type { i32 }
4 %struct.lang_decl = type opaque
5 %struct.lang_type = type { i32, [1 x %struct.tree_node*] }
6 %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (...)*, void (...)*, i8*, i8 }
7 %struct.rtx_def = type { i16, i8, i8, [1 x %struct.anon] }
8 %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, i8, i8, i8, i8 }
9 %struct.tree_decl = type { [12 x i8], i8*, i32, %struct.tree_node*, i32, i8, i8, i8, i8, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
10 %struct.tree_list = type { [12 x i8], %struct.tree_node*, %struct.tree_node* }
11 %struct.tree_node = type { %struct.tree_decl }
12 %struct.tree_type = type { [12 x i8], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i8, i8, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.anon, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.obstack*, %struct.lang_type* }
13 @void_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
14 @char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
15 @short_integer_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
16 @short_unsigned_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
17 @float_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
18 @signed_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
19 @unsigned_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
220
3 %struct._obstack_chunk = type { sbyte*, %struct._obstack_chunk*, [4 x sbyte] }
4 %struct.anon = type { int }
5 %struct.lang_decl = type opaque
6 %struct.lang_type = type { int, [1 x %struct.tree_node*] }
7 %struct.obstack = type { int, %struct._obstack_chunk*, sbyte*, sbyte*, sbyte*, int, int, %struct._obstack_chunk* (...)*, void (...)*, sbyte*, ubyte }
8 %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct.anon] }
9 %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, ubyte, ubyte, ubyte, ubyte }
10 %struct.tree_decl = type { [12 x sbyte], sbyte*, int, %struct.tree_node*, uint, ubyte, ubyte, ubyte, ubyte, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.anon, { %struct.rtx_def* }, %struct.tree_node*, %struct.lang_decl* }
11 %struct.tree_list = type { [12 x sbyte], %struct.tree_node*, %struct.tree_node* }
12 %struct.tree_node = type { %struct.tree_decl }
13 %struct.tree_type = type { [12 x sbyte], %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, uint, ubyte, ubyte, ubyte, ubyte, uint, %struct.tree_node*, %struct.tree_node*, %struct.anon, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.obstack*, %struct.lang_type* }
14 %void_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
15 %char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
16 %short_integer_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
17 %short_unsigned_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
18 %float_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
19 %signed_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
20 %unsigned_char_type_node = external global %struct.tree_node* ; <%struct.tree_node**> [#uses=1]
21
22 implementation ; Functions:
23
24 fastcc int %self_promoting_args_p(%struct.tree_node* %parms) {
21 define fastcc i32 @self_promoting_args_p(%struct.tree_node* %parms) {
2522 entry:
26 %tmp915 = seteq %struct.tree_node* %parms, null ; [#uses=1]
27 br bool %tmp915, label %return, label %cond_true92.preheader
23 %tmp915 = icmp eq %struct.tree_node* %parms, null ; [#uses=1]
24 br i1 %tmp915, label %return, label %cond_true92.preheader
2825
2926 cond_true: ; preds = %cond_true92
30 %tmp9.not = setne %struct.tree_node* %tmp2, %tmp7 ; [#uses=1]
31 %tmp14 = seteq %struct.tree_node* %tmp2, null ; [#uses=1]
32 %bothcond = or bool %tmp9.not, %tmp14 ; [#uses=1]
33 br bool %bothcond, label %return, label %cond_next18
27 %tmp9.not = icmp ne %struct.tree_node* %tmp2, %tmp7 ; [#uses=1]
28 %tmp14 = icmp eq %struct.tree_node* %tmp2, null ; [#uses=1]
29 %bothcond = or i1 %tmp9.not, %tmp14 ; [#uses=1]
30 br i1 %bothcond, label %return, label %cond_next18
3431
3532 cond_next12: ; preds = %cond_true92
36 %tmp14.old = seteq %struct.tree_node* %tmp2, null ; [#uses=1]
37 br bool %tmp14.old, label %return, label %cond_next18
33 %tmp14.old = icmp eq %struct.tree_node* %tmp2, null ; [#uses=1]
34 br i1 %tmp14.old, label %return, label %cond_next18
3835
3936 cond_next18: ; preds = %cond_next12, %cond_true
40 %tmp20 = cast %struct.tree_node* %tmp2 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
41 %tmp21 = getelementptr %struct.tree_type* %tmp20, int 0, uint 17 ; <%struct.tree_node**> [#uses=1]
37 %tmp20 = bitcast %struct.tree_node* %tmp2 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1]
38 %tmp21 = getelementptr %struct.tree_type* %tmp20, i32 0, i32 17 ; <%struct.tree_node**> [#uses=1]
4239 %tmp22 = load %struct.tree_node** %tmp21 ; <%struct.tree_node*> [#uses=6]
43 %tmp24 = seteq %struct.tree_node* %tmp22, %tmp23 ; [#uses=1]
44 br bool %tmp24, label %return, label %cond_next28
40 %tmp24 = icmp eq %struct.tree_node* %tmp22, %tmp23 ; [#uses=1]
41 br i1 %tmp24, label %return, label %cond_next28
4542
4643 cond_next28: ; preds = %cond_next18
47 %tmp30 = cast %struct.tree_node* %tmp2 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
48 %tmp = getelementptr %struct.tree_common* %tmp30, int 0, uint 2 ; [#uses=1]
49 %tmp = cast ubyte* %tmp to uint* ; [#uses=1]
50 %tmp = load uint* %tmp ; [#uses=1]
51 %tmp32 = cast uint %tmp to ubyte ; [#uses=1]
52 %tmp33 = seteq ubyte %tmp32, 7 ; [#uses=1]
53 br bool %tmp33, label %cond_true34, label %cond_next84
44 %tmp30 = bitcast %struct.tree_node* %tmp2 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
45 %tmp = getelementptr %struct.tree_common* %tmp30, i32 0, i32 2 ; [#uses=1]
46 %tmp.upgrd.1 = bitcast i8* %tmp to i32* ; [#uses=1]
47 %tmp.upgrd.2 = load i32* %tmp.upgrd.1 ; [#uses=1]
48 %tmp32 = trunc i32 %tmp.upgrd.2 to i8 ; [#uses=1]
49 %tmp33 = icmp eq i8 %tmp32, 7 ; [#uses=1]
50 br i1 %tmp33, label %cond_true34, label %cond_next84
5451
5552 cond_true34: ; preds = %cond_next28
56 %tmp40 = seteq %struct.tree_node* %tmp22, %tmp39 ; [#uses=1]
57 %tmp49 = seteq %struct.tree_node* %tmp22, %tmp48 ; [#uses=1]
58 %bothcond6 = or bool %tmp40, %tmp49 ; [#uses=1]
59 %tmp58 = seteq %struct.tree_node* %tmp22, %tmp57 ; [#uses=1]
60 %bothcond7 = or bool %bothcond6, %tmp58 ; [#uses=1]
61 %tmp67 = seteq %struct.tree_node* %tmp22, %tmp66 ; [#uses=1]
62 %bothcond8 = or bool %bothcond7, %tmp67 ; [#uses=1]
63 %tmp76 = seteq %struct.tree_node* %tmp22, %tmp75 ; [#uses=1]
64 %bothcond9 = or bool %bothcond8, %tmp76 ; [#uses=2]
65 %brmerge = or bool %bothcond9, %tmp ; [#uses=1]
66 %bothcond9 = cast bool %bothcond9 to int ; [#uses=1]
67 %.mux = xor int %bothcond9, 1 ; [#uses=1]
68 br bool %brmerge, label %return, label %cond_true92
53 %tmp40 = icmp eq %struct.tree_node* %tmp22, %tmp39 ; [#uses=1]
54 %tmp49 = icmp eq %struct.tree_node* %tmp22, %tmp48 ; [#uses=1]
55 %bothcond6 = or i1 %tmp40, %tmp49 ; [#uses=1]
56 %tmp58 = icmp eq %struct.tree_node* %tmp22, %tmp57 ; [#uses=1]
57 %bothcond7 = or i1 %bothcond6, %tmp58 ; [#uses=1]
58 %tmp67 = icmp eq %struct.tree_node* %tmp22, %tmp66 ; [#uses=1]
59 %bothcond8 = or i1 %bothcond7, %tmp67 ; [#uses=1]
60 %tmp76 = icmp eq %struct.tree_node* %tmp22, %tmp75 ; [#uses=1]
61 %bothcond9 = or i1 %bothcond8, %tmp76 ; [#uses=2]
62 %brmerge = or i1 %bothcond9, %tmp.upgrd.6 ; [#uses=1]
63 %bothcond9.upgrd.3 = zext i1 %bothcond9 to i32 ; [#uses=1]
64 %.mux = xor i32 %bothcond9.upgrd.3, 1 ; [#uses=1]
65 br i1 %brmerge, label %return, label %cond_true92
6966
7067 cond_next84: ; preds = %cond_next28
71 br bool %tmp, label %return, label %cond_true92
68 br i1 %tmp.upgrd.6, label %return, label %cond_true92
7269
7370 cond_true92.preheader: ; preds = %entry
74 %tmp7 = load %struct.tree_node** %void_type_node ; <%struct.tree_node*> [#uses=1]
75 %tmp23 = load %struct.tree_node** %float_type_node ; <%struct.tree_node*> [#uses=1]
76 %tmp39 = load %struct.tree_node** %char_type_node ; <%struct.tree_node*> [#uses=1]
77 %tmp48 = load %struct.tree_node** %signed_char_type_node ; <%struct.tree_node*> [#uses=1]
78 %tmp57 = load %struct.tree_node** %unsigned_char_type_node ; <%struct.tree_node*> [#uses=1]
79 %tmp66 = load %struct.tree_node** %short_integer_type_node ; <%struct.tree_node*> [#uses=1]
80 %tmp75 = load %struct.tree_node** %short_unsigned_type_node ; <%struct.tree_node*> [#uses=1]
71 %tmp7 = load %struct.tree_node** @void_type_node ; <%struct.tree_node*> [#uses=1]
72 %tmp23 = load %struct.tree_node** @float_type_node ; <%struct.tree_node*> [#uses=1]
73 %tmp39 = load %struct.tree_node** @char_type_node ; <%struct.tree_node*> [#uses=1]
74 %tmp48 = load %struct.tree_node** @signed_char_type_node ; <%struct.tree_node*> [#uses=1]
75 %tmp57 = load %struct.tree_node** @unsigned_char_type_node ; <%struct.tree_node*> [#uses=1]
76 %tmp66 = load %struct.tree_node** @short_integer_type_node ; <%struct.tree_node*> [#uses=1]
77 %tmp75 = load %struct.tree_node** @short_unsigned_type_node ; <%struct.tree_node*> [#uses=1]
8178 br label %cond_true92
8279
8380 cond_true92: ; preds = %cond_true92.preheader, %cond_next84, %cond_true34
8481 %t.0.0 = phi %struct.tree_node* [ %parms, %cond_true92.preheader ], [ %tmp6, %cond_true34 ], [ %tmp6, %cond_next84 ] ; <%struct.tree_node*> [#uses=2]
85 %tmp = cast %struct.tree_node* %t.0.0 to %struct.tree_list* ; <%struct.tree_list*> [#uses=1]
86 %tmp = getelementptr %struct.tree_list* %tmp, int 0, uint 2 ; <%struct.tree_node**> [#uses=1]
87 %tmp2 = load %struct.tree_node** %tmp ; <%struct.tree_node*> [#uses=5]
88 %tmp4 = cast %struct.tree_node* %t.0.0 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
89 %tmp5 = getelementptr %struct.tree_common* %tmp4, int 0, uint 0 ; <%struct.tree_node**> [#uses=1]
82 %tmp.upgrd.4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_list* ; <%struct.tree_list*> [#uses=1]
83 %tmp.upgrd.5 = getelementptr %struct.tree_list* %tmp.upgrd.4, i32 0, i32 2 ; <%struct.tree_node**> [#uses=1]
84 %tmp2 = load %struct.tree_node** %tmp.upgrd.5 ; <%struct.tree_node*> [#uses=5]
85 %tmp4 = bitcast %struct.tree_node* %t.0.0 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
86 %tmp5 = getelementptr %struct.tree_common* %tmp4, i32 0, i32 0 ; <%struct.tree_node**> [#uses=1]
9087 %tmp6 = load %struct.tree_node** %tmp5 ; <%struct.tree_node*> [#uses=3]
91 %tmp = seteq %struct.tree_node* %tmp6, null ; [#uses=3]
92 br bool %tmp, label %cond_true, label %cond_next12
88 %tmp.upgrd.6 = icmp eq %struct.tree_node* %tmp6, null ; [#uses=3]
89 br i1 %tmp.upgrd.6, label %cond_true, label %cond_next12
9390
9491 return: ; preds = %cond_next84, %cond_true34, %cond_next18, %cond_next12, %cond_true, %entry
95 %retval.0 = phi int [ 1, %entry ], [ 1, %cond_next84 ], [ %.mux, %cond_true34 ], [ 0, %cond_next18 ], [ 0, %cond_next12 ], [ 0, %cond_true ] ; [#uses=1]
96 ret int %retval.0
92 %retval.0 = phi i32 [ 1, %entry ], [ 1, %cond_next84 ], [ %.mux, %cond_true34 ], [ 0, %cond_next18 ], [ 0, %cond_next12 ], [ 0, %cond_true ] ; [#uses=1]
93 ret i32 %retval.0
9794 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 implementation ; Functions:
2 declare void @llvm.dbg.declare({ }*, { }*)
33
4 declare void %llvm.dbg.declare({ }*, { }*)
4 define void @foo() {
5 call void @llvm.dbg.declare( { }* null, { }* null )
6 ret void
7 }
58
6 void %foo() {
7 call void %llvm.dbg.declare( { }* null, { }* null )
8 ret void
9 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah
0 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
11
22 ; The vload was getting memoized to the previous scalar load!
33
4 void %VertexProgram2() {
4 define void @VertexProgram2() {
55 %xFloat0.688 = load float* null ; [#uses=0]
66 %loadVector37.712 = load <4 x float>* null ; <<4 x float>> [#uses=1]
7 %inFloat3.713 = insertelement <4 x float> %loadVector37.712, float 0.000000e+00, uint 3 ; <<4 x float>> [#uses=1]
7 %inFloat3.713 = insertelement <4 x float> %loadVector37.712, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
88 store <4 x float> %inFloat3.713, <4 x float>* null
99 unreachable
1010 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11 ; PR748
2 @G = external global i16 ; [#uses=1]
23
3 %G = external global ushort ; [#uses=1]
4
5 implementation ; Functions:
6
7 void %OmNewObjHdr() {
4 define void @OmNewObjHdr() {
85 entry:
9 br bool false, label %endif.4, label %then.0
6 br i1 false, label %endif.4, label %then.0
107
118 then.0: ; preds = %entry
129 ret void
1310
1411 endif.4: ; preds = %entry
15 br bool false, label %else.3, label %shortcirc_next.3
12 br i1 false, label %else.3, label %shortcirc_next.3
1613
1714 shortcirc_next.3: ; preds = %endif.4
1815 ret void
1916
2017 else.3: ; preds = %endif.4
21 switch int 0, label %endif.10 [
22 int 5001, label %then.10
23 int -5008, label %then.10
18 switch i32 0, label %endif.10 [
19 i32 5001, label %then.10
20 i32 -5008, label %then.10
2421 ]
2522
2623 then.10: ; preds = %else.3, %else.3
27 %tmp.112 = load ushort* null ; [#uses=2]
28 %tmp.113 = load ushort* %G ; [#uses=2]
29 %tmp.114 = setgt ushort %tmp.112, %tmp.113 ; [#uses=1]
30 %tmp.120 = setlt ushort %tmp.112, %tmp.113 ; [#uses=1]
31 %bothcond = and bool %tmp.114, %tmp.120 ; [#uses=1]
32 br bool %bothcond, label %else.4, label %then.11
24 %tmp.112 = load i16* null ; [#uses=2]
25 %tmp.113 = load i16* @G ; [#uses=2]
26 %tmp.114 = icmp ugt i16 %tmp.112, %tmp.113 ; [#uses=1]
27 %tmp.120 = icmp ult i16 %tmp.112, %tmp.113 ; [#uses=1]
28 %bothcond = and i1 %tmp.114, %tmp.120 ; [#uses=1]
29 br i1 %bothcond, label %else.4, label %then.11
3330
3431 then.11: ; preds = %then.10
3532 ret void
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 int %test(int %tmp93) {
3 %tmp98 = shl int %tmp93, ubyte 31 ; [#uses=1]
4 %tmp99 = shr int %tmp98, ubyte 31 ; [#uses=1]
5 %tmp99 = cast int %tmp99 to sbyte ; [#uses=1]
6 %tmp99100 = cast sbyte %tmp99 to int ; [#uses=1]
7 ret int %tmp99100
2 define i32 @test(i32 %tmp93) {
3 %tmp98 = shl i32 %tmp93, 31 ; [#uses=1]
4 %tmp99 = ashr i32 %tmp98, 31 ; [#uses=1]
5 %tmp99.upgrd.1 = trunc i32 %tmp99 to i8 ; [#uses=1]
6 %tmp99100 = sext i8 %tmp99.upgrd.1 to i32 ; [#uses=1]
7 ret i32 %tmp99100
88 }
9
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
1 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
2 %struct.SYMBOL_TABLE_ENTRY = type { [9 x i8], [9 x i8], i32, i32, i32, %struct.SYMBOL_TABLE_ENTRY* }
3 %struct.__sFILEX = type opaque
4 %struct.__sbuf = type { i8*, i32 }
5 @str14 = external global [6 x i8] ; <[6 x i8]*> [#uses=0]
16
2 %struct.FILE = type { ubyte*, int, int, short, short, %struct.__sbuf, int, sbyte*, int (sbyte*)*, int (sbyte*, sbyte*, int)*, long (sbyte*, long, int)*, int (sbyte*, s