llvm.org GIT mirror llvm / 6f729d6
Byebye llvm-upgrade! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48762 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 12 years ago
110 changed file(s) with 1895 addition(s) and 2210 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 void %main() {
3 %tr4 = shl ulong 1, ubyte 0 ; [#uses=0]
4 ret void
2 define void @main() {
3 %tr4 = shl i64 1, 0 ; [#uses=0]
4 ret void
55 }
6
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 void %main() {
3 %shamt = add ubyte 0, 1 ; [#uses=1]
4 %tr2 = shr long 1, ubyte %shamt ; [#uses=0]
5 ret void
2 define void @main() {
3 %shamt = add i8 0, 1 ; [#uses=1]
4 %shift.upgrd.1 = zext i8 %shamt to i64 ; [#uses=1]
5 %tr2 = ashr i64 1, %shift.upgrd.1 ; [#uses=0]
6 ret void
67 }
8
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep .comm.*X,0
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep .comm.*X,0
11
2 %X = linkonce global {} {}
2 @X = linkonce global { } zeroinitializer ; <{ }*> [#uses=0]
3
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 int %main() {
3 %setle = setle long 1, 0
4 %select = select bool true, bool %setle, bool true
5 ret int 0
2 define i32 @main() {
3 %setle = icmp sle i64 1, 0 ; [#uses=1]
4 %select = select i1 true, i1 %setle, i1 true ; [#uses=0]
5 ret i32 0
66 }
77
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 long %test() { ret long undef }
2 define i64 @test() {
3 ret i64 undef
4 }
0 ; this should not crash the ppc backend
11
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
2 ; RUN: llvm-as < %s | llc -march=ppc32
33
4 uint %test( int %j.0.0.i) {
5 %tmp.85.i = and int %j.0.0.i, 7
6 %tmp.161278.i = cast int %tmp.85.i to uint
7 %tmp.5.i77.i = shr uint %tmp.161278.i, ubyte 3
8 ret uint %tmp.5.i77.i
4
5 define i32 @test(i32 %j.0.0.i) {
6 %tmp.85.i = and i32 %j.0.0.i, 7 ; [#uses=1]
7 %tmp.161278.i = bitcast i32 %tmp.85.i to i32 ; [#uses=1]
8 %tmp.5.i77.i = lshr i32 %tmp.161278.i, 3 ; [#uses=1]
9 ret i32 %tmp.5.i77.i
910 }
1011
1112
0 ; This function should have exactly one call to fixdfdi, no more!
11
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mattr=-64bit | \
2 ; RUN: llvm-as < %s | llc -march=ppc32 -mattr=-64bit | \
33 ; RUN: grep {bl .*fixdfdi} | count 1
44
5 double %test2(double %tmp.7705) {
6 %mem_tmp.2.0.in = cast double %tmp.7705 to long ; [#uses=1]
7 %mem_tmp.2.0 = cast long %mem_tmp.2.0.in to double
8 ret double %mem_tmp.2.0
5 define double @test2(double %tmp.7705) {
6 %mem_tmp.2.0.in = fptosi double %tmp.7705 to i64 ; [#uses=1]
7 %mem_tmp.2.0 = sitofp i64 %mem_tmp.2.0.in to double ; [#uses=1]
8 ret double %mem_tmp.2.0
99 }
10
0 ; This was erroneously being turned into an rlwinm instruction.
11 ; The sign bit does matter in this case.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep srawi
4 int %test(int %X) {
5 %Y = and int %X, -2
6 %Z = shr int %Y, ubyte 11
7 ret int %Z
3 ; RUN: llvm-as < %s | llc -march=ppc32 | grep srawi
4
5 define i32 @test(i32 %X) {
6 %Y = and i32 %X, -2 ; [#uses=1]
7 %Z = ashr i32 %Y, 11 ; [#uses=1]
8 ret i32 %Z
89 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc
1 target endian = big
2 target pointersize = 32
0 ; RUN: llvm-as < %s | llc
1
2 target datalayout = "E-p:32:32"
33 target triple = "powerpc-apple-darwin8.2.0"
4 implementation ; Functions:
54
6 void %bar(int %G, int %E, int %F, int %A, int %B, int %C, int %D, sbyte* %fmt, ...) {
7 %ap = alloca sbyte* ; [#uses=2]
8 call void %llvm.va_start( sbyte** %ap )
9 %tmp.1 = load sbyte** %ap ; [#uses=1]
10 %tmp.0 = call double %foo( sbyte* %tmp.1 ) ; [#uses=0]
11 ret void
5 define void @bar(i32 %G, i32 %E, i32 %F, i32 %A, i32 %B, i32 %C, i32 %D, i8* %fmt, ...) {
6 %ap = alloca i8* ; [#uses=2]
7 %va.upgrd.1 = bitcast i8** %ap to i8* ; [#uses=1]
8 call void @llvm.va_start( i8* %va.upgrd.1 )
9 %tmp.1 = load i8** %ap ; [#uses=1]
10 %tmp.0 = call double @foo( i8* %tmp.1 ) ; [#uses=0]
11 ret void
1212 }
1313
14 declare void %llvm.va_start(sbyte**)
14 declare void @llvm.va_start(i8*)
1515
16 declare double %foo(sbyte*)
16 declare double @foo(i8*)
17
None ; RUN: llvm-upgrade < %s | llvm-as | llc | not grep {, f1}
0 ; RUN: llvm-as < %s | llc | not grep {, f1}
11
2 target endian = big
3 target pointersize = 32
2 target datalayout = "E-p:32:32"
43 target triple = "powerpc-apple-darwin8.2.0"
54
65 ; Dead argument should reserve an FP register.
7 double %bar(double %DEAD, double %X, double %Y) {
8 %tmp.2 = add double %X, %Y
6 define double @bar(double %DEAD, double %X, double %Y) {
7 %tmp.2 = add double %X, %Y ; [#uses=1]
98 ret double %tmp.2
109 }
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 void %iterative_hash_host_wide_int() {
3 %zero = alloca int ; [#uses=2]
4 %b = alloca uint ; [#uses=1]
5 store int 0, int* %zero
6 %tmp = load int* %zero ; [#uses=1]
7 %tmp5 = cast int %tmp to uint ; [#uses=1]
8 %tmp6.u = add uint %tmp5, 32 ; [#uses=1]
9 %tmp6 = cast uint %tmp6.u to int ; [#uses=1]
10 %tmp7 = load long* null ; [#uses=1]
11 %tmp6 = cast int %tmp6 to ubyte ; [#uses=1]
12 %tmp8 = shr long %tmp7, ubyte %tmp6 ; [#uses=1]
13 %tmp8 = cast long %tmp8 to uint ; [#uses=1]
14 store uint %tmp8, uint* %b
15 unreachable
2 define void @iterative_hash_host_wide_int() {
3 %zero = alloca i32 ; [#uses=2]
4 %b = alloca i32 ; [#uses=1]
5 store i32 0, i32* %zero
6 %tmp = load i32* %zero ; [#uses=1]
7 %tmp5 = bitcast i32 %tmp to i32 ; [#uses=1]
8 %tmp6.u = add i32 %tmp5, 32 ; [#uses=1]
9 %tmp6 = bitcast i32 %tmp6.u to i32 ; [#uses=1]
10 %tmp7 = load i64* null ; [#uses=1]
11 %tmp6.upgrd.1 = trunc i32 %tmp6 to i8 ; [#uses=1]
12 %shift.upgrd.2 = zext i8 %tmp6.upgrd.1 to i64 ; [#uses=1]
13 %tmp8 = ashr i64 %tmp7, %shift.upgrd.2 ; [#uses=1]
14 %tmp8.upgrd.3 = trunc i64 %tmp8 to i32 ; [#uses=1]
15 store i32 %tmp8.upgrd.3, i32* %b
16 unreachable
1617 }
18
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 double %CalcSpeed(float %tmp127) {
3 %tmp145 = cast float %tmp127 to double ; [#uses=1]
4 %tmp150 = call double asm "frsqrte $0,$1", "=f,f"( double %tmp145 ) ; [#uses=0]
5 ret double %tmp150
2
3 define double @CalcSpeed(float %tmp127) {
4 %tmp145 = fpext float %tmp127 to double ; [#uses=1]
5 %tmp150 = call double asm "frsqrte $0,$1", "=f,f"( double %tmp145 ) ; [#uses=1]
6 ret double %tmp150
67 }
8
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
22 ; RUN: grep {vspltish v.*, 10}
33
4 void %test(<8 x short>* %P) {
5 %tmp = load <8 x short>* %P ; <<8 x short>> [#uses=1]
6 %tmp1 = add <8 x short> %tmp, < short 10, short 10, short 10, short 10, short 10, short 10, short 10, short 10 > ; <<8 x short>> [#uses=1]
7 store <8 x short> %tmp1, <8 x short>* %P
8 ret void
4 define void @test(<8 x i16>* %P) {
5 %tmp = load <8 x i16>* %P ; <<8 x i16>> [#uses=1]
6 %tmp1 = add <8 x i16> %tmp, < i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10 > ; <<8 x i16>> [#uses=1]
7 store <8 x i16> %tmp1, <8 x i16>* %P
8 ret void
99 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5
0 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
1 ; END.
12
2 void %test(sbyte* %stack) {
3 define void @test(i8* %stack) {
34 entry:
4 %tmp9 = seteq int 0, 0 ; [#uses=1]
5 %tmp30 = seteq uint 0, 0 ; [#uses=1]
6 br bool %tmp30, label %cond_next54, label %cond_true31
7
5 %tmp9 = icmp eq i32 0, 0 ; [#uses=1]
6 %tmp30 = icmp eq i32 0, 0 ; [#uses=1]
7 br i1 %tmp30, label %cond_next54, label %cond_true31
88 cond_true860: ; preds = %bb855
9 %tmp879 = tail call <4 x float> %llvm.ppc.altivec.vmaddfp( <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
10 %tmp880 = cast <4 x float> %tmp879 to <4 x int> ; <<4 x int>> [#uses=2]
11 %tmp883 = shufflevector <4 x int> %tmp880, <4 x int> undef, <4 x uint> < uint 1, uint 1, uint 1, uint 1 > ; <<4 x int>> [#uses=1]
12 %tmp883 = cast <4 x int> %tmp883 to <4 x float> ; <<4 x float>> [#uses=1]
13 %tmp885 = shufflevector <4 x int> %tmp880, <4 x int> undef, <4 x uint> < uint 2, uint 2, uint 2, uint 2 > ; <<4 x int>> [#uses=1]
14 %tmp885 = cast <4 x int> %tmp885 to <4 x float> ; <<4 x float>> [#uses=1]
9 %tmp879 = tail call <4 x float> @llvm.ppc.altivec.vmaddfp( <4 x float> zeroinitializer, <4 x float> zeroinitializer, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
10 %tmp880 = bitcast <4 x float> %tmp879 to <4 x i32> ; <<4 x i32>> [#uses=2]
11 %tmp883 = shufflevector <4 x i32> %tmp880, <4 x i32> undef, <4 x i32> < i32 1, i32 1, i32 1, i32 1 > ; <<4 x i32>> [#uses=1]
12 %tmp883.upgrd.1 = bitcast <4 x i32> %tmp883 to <4 x float> ; <<4 x float>> [#uses=1]
13 %tmp885 = shufflevector <4 x i32> %tmp880, <4 x i32> undef, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x i32>> [#uses=1]
14 %tmp885.upgrd.2 = bitcast <4 x i32> %tmp885 to <4 x float> ; <<4 x float>> [#uses=1]
1515 br label %cond_next905
16
1716 cond_true31: ; preds = %entry
1817 ret void
19
2018 cond_next54: ; preds = %entry
21 br bool %tmp9, label %cond_false385, label %bb279
22
19 br i1 %tmp9, label %cond_false385, label %bb279
2320 bb279: ; preds = %cond_next54
2421 ret void
25
2622 cond_false385: ; preds = %cond_next54
27 %tmp388 = seteq uint 0, 0 ; [#uses=1]
28 br bool %tmp388, label %cond_next463, label %cond_true389
29
23 %tmp388 = icmp eq i32 0, 0 ; [#uses=1]
24 br i1 %tmp388, label %cond_next463, label %cond_true389
3025 cond_true389: ; preds = %cond_false385
3126 ret void
32
3327 cond_next463: ; preds = %cond_false385
34 %tmp1208107 = setgt sbyte* null, %stack ; [#uses=1]
35 br bool %tmp1208107, label %cond_true1209.preheader, label %bb1212
36
28 %tmp1208107 = icmp ugt i8* null, %stack ; [#uses=1]
29 br i1 %tmp1208107, label %cond_true1209.preheader, label %bb1212
3730 cond_true498: ; preds = %cond_true1209.preheader
3831 ret void
39
4032 cond_true519: ; preds = %cond_true1209.preheader
41 %bothcond = or bool false, false ; [#uses=1]
42 br bool %bothcond, label %bb855, label %bb980
43
33 %bothcond = or i1 false, false ; [#uses=1]
34 br i1 %bothcond, label %bb855, label %bb980
4435 cond_false548: ; preds = %cond_true1209.preheader
4536 ret void
46
4737 bb855: ; preds = %cond_true519
48 %tmp859 = seteq int 0, 0 ; [#uses=1]
49 br bool %tmp859, label %cond_true860, label %cond_next905
50
38 %tmp859 = icmp eq i32 0, 0 ; [#uses=1]
39 br i1 %tmp859, label %cond_true860, label %cond_next905
5140 cond_next905: ; preds = %bb855, %cond_true860
52 %vfpw2.4 = phi <4 x float> [ %tmp885, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
53 %vfpw1.4 = phi <4 x float> [ %tmp883, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
54 %tmp930 = cast <4 x float> zeroinitializer to <4 x int> ; <<4 x int>> [#uses=0]
41 %vfpw2.4 = phi <4 x float> [ %tmp885.upgrd.2, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
42 %vfpw1.4 = phi <4 x float> [ %tmp883.upgrd.1, %cond_true860 ], [ undef, %bb855 ] ; <<4 x float>> [#uses=0]
43 %tmp930 = bitcast <4 x float> zeroinitializer to <4 x i32> ; <<4 x i32>> [#uses=0]
5544 ret void
56
5745 bb980: ; preds = %cond_true519
5846 ret void
59
6047 cond_true1209.preheader: ; preds = %cond_next463
61 %tmp496 = and uint 0, 12288 ; [#uses=1]
62 switch uint %tmp496, label %cond_false548 [
63 uint 0, label %cond_true498
64 uint 4096, label %cond_true519
48 %tmp496 = and i32 0, 12288 ; [#uses=1]
49 switch i32 %tmp496, label %cond_false548 [
50 i32 0, label %cond_true498
51 i32 4096, label %cond_true519
6552 ]
66
6753 bb1212: ; preds = %cond_next463
6854 ret void
6955 }
7056
71 declare <4 x float> %llvm.ppc.altivec.vmaddfp(<4 x float>, <4 x float>, <4 x float>)
57 declare <4 x float> @llvm.ppc.altivec.vmaddfp(<4 x float>, <4 x float>, <4 x float>)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
1 ; END.
12
2 %struct.attr_desc = type { sbyte*, %struct.attr_desc*, %struct.attr_value*, %struct.attr_value*, uint }
3 %struct.attr_value = type { %struct.rtx_def*, %struct.attr_value*, %struct.insn_ent*, int, int }
4 %struct.insn_def = type { %struct.insn_def*, %struct.rtx_def*, int, int, int, int, int }
3 %struct.attr_desc = type { i8*, %struct.attr_desc*, %struct.attr_value*, %struct.attr_value*, i32 }
4 %struct.attr_value = type { %struct.rtx_def*, %struct.attr_value*, %struct.insn_ent*, i32, i32 }
5 %struct.insn_def = type { %struct.insn_def*, %struct.rtx_def*, i32, i32, i32, i32, i32 }
56 %struct.insn_ent = type { %struct.insn_ent*, %struct.insn_def* }
6 %struct.rtx_def = type { ushort, ubyte, ubyte, %struct.u }
7 %struct.u = type { [1 x long] }
7 %struct.rtx_def = type { i16, i8, i8, %struct.u }
8 %struct.u = type { [1 x i64] }
89
9 implementation ; Functions:
10
11 void %find_attr() {
10 define void @find_attr() {
1211 entry:
13 %tmp26 = seteq %struct.attr_desc* null, null ; [#uses=1]
14 br bool %tmp26, label %bb30, label %cond_true27
15
12 %tmp26 = icmp eq %struct.attr_desc* null, null ; [#uses=1]
13 br i1 %tmp26, label %bb30, label %cond_true27
1614 cond_true27: ; preds = %entry
1715 ret void
18
1916 bb30: ; preds = %entry
20 %tmp67 = seteq %struct.attr_desc* null, null ; [#uses=1]
21 br bool %tmp67, label %cond_next92, label %cond_true68
22
17 %tmp67 = icmp eq %struct.attr_desc* null, null ; [#uses=1]
18 br i1 %tmp67, label %cond_next92, label %cond_true68
2319 cond_true68: ; preds = %bb30
2420 ret void
25
2621 cond_next92: ; preds = %bb30
27 %tmp173 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=2]
28 %tmp174 = load uint* %tmp173 ; [#uses=1]
29 %tmp177 = and uint %tmp174, 4294967287 ; [#uses=1]
30 store uint %tmp177, uint* %tmp173
31 %tmp180 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=1]
32 %tmp181 = load uint* %tmp180 ; [#uses=1]
33 %tmp185 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=2]
34 %tmp186 = load uint* %tmp185 ; [#uses=1]
35 %tmp183187 = shl uint %tmp181, ubyte 1 ; [#uses=1]
36 %tmp188 = and uint %tmp183187, 16 ; [#uses=1]
37 %tmp190 = and uint %tmp186, 4294967279 ; [#uses=1]
38 %tmp191 = or uint %tmp190, %tmp188 ; [#uses=1]
39 store uint %tmp191, uint* %tmp185
40 %tmp193 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=1]
41 %tmp194 = load uint* %tmp193 ; [#uses=1]
42 %tmp198 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=2]
43 %tmp199 = load uint* %tmp198 ; [#uses=1]
44 %tmp196200 = shl uint %tmp194, ubyte 2 ; [#uses=1]
45 %tmp201 = and uint %tmp196200, 64 ; [#uses=1]
46 %tmp203 = and uint %tmp199, 4294967231 ; [#uses=1]
47 %tmp204 = or uint %tmp203, %tmp201 ; [#uses=1]
48 store uint %tmp204, uint* %tmp198
49 %tmp206 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=1]
50 %tmp207 = load uint* %tmp206 ; [#uses=1]
51 %tmp211 = getelementptr %struct.attr_desc* null, int 0, uint 4 ; [#uses=2]
52 %tmp212 = load uint* %tmp211 ; [#uses=1]
53 %tmp209213 = shl uint %tmp207, ubyte 1 ; [#uses=1]
54 %tmp214 = and uint %tmp209213, 128 ; [#uses=1]
55 %tmp216 = and uint %tmp212, 4294967167 ; [#uses=1]
56 %tmp217 = or uint %tmp216, %tmp214 ; [#uses=1]
57 store uint %tmp217, uint* %tmp211
22 %tmp173 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=2]
23 %tmp174 = load i32* %tmp173 ; [#uses=1]
24 %tmp177 = and i32 %tmp174, -9 ; [#uses=1]
25 store i32 %tmp177, i32* %tmp173
26 %tmp180 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=1]
27 %tmp181 = load i32* %tmp180 ; [#uses=1]
28 %tmp185 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=2]
29 %tmp186 = load i32* %tmp185 ; [#uses=1]
30 %tmp183187 = shl i32 %tmp181, 1 ; [#uses=1]
31 %tmp188 = and i32 %tmp183187, 16 ; [#uses=1]
32 %tmp190 = and i32 %tmp186, -17 ; [#uses=1]
33 %tmp191 = or i32 %tmp190, %tmp188 ; [#uses=1]
34 store i32 %tmp191, i32* %tmp185
35 %tmp193 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=1]
36 %tmp194 = load i32* %tmp193 ; [#uses=1]
37 %tmp198 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=2]
38 %tmp199 = load i32* %tmp198 ; [#uses=1]
39 %tmp196200 = shl i32 %tmp194, 2 ; [#uses=1]
40 %tmp201 = and i32 %tmp196200, 64 ; [#uses=1]
41 %tmp203 = and i32 %tmp199, -65 ; [#uses=1]
42 %tmp204 = or i32 %tmp203, %tmp201 ; [#uses=1]
43 store i32 %tmp204, i32* %tmp198
44 %tmp206 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=1]
45 %tmp207 = load i32* %tmp206 ; [#uses=1]
46 %tmp211 = getelementptr %struct.attr_desc* null, i32 0, i32 4 ; [#uses=2]
47 %tmp212 = load i32* %tmp211 ; [#uses=1]
48 %tmp209213 = shl i32 %tmp207, 1 ; [#uses=1]
49 %tmp214 = and i32 %tmp209213, 128 ; [#uses=1]
50 %tmp216 = and i32 %tmp212, -129 ; [#uses=1]
51 %tmp217 = or i32 %tmp216, %tmp214 ; [#uses=1]
52 store i32 %tmp217, i32* %tmp211
5853 ret void
5954 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc64-apple-darwin | grep extsw | count 2
0 ; RUN: llvm-as < %s | llc -mtriple=powerpc64-apple-darwin | grep extsw | count 2
11
2 %lens = external global ubyte*
3 %vals = external global int*
2 @lens = external global i8* ; [#uses=1]
3 @vals = external global i32* ; [#uses=1]
44
5 int %test(int %i) {
6 %tmp = load ubyte** %lens
7 %tmp1 = getelementptr ubyte* %tmp, int %i
8 %tmp = load ubyte* %tmp1
9 %tmp2 = cast ubyte %tmp to int
10 %tmp3 = load int** %vals
11 %tmp5 = sub int 1, %tmp2
12 %tmp6 = getelementptr int* %tmp3, int %tmp5
13 %tmp7 = load int* %tmp6
14 ret int %tmp7
5 define i32 @test(i32 %i) {
6 %tmp = load i8** @lens ; [#uses=1]
7 %tmp1 = getelementptr i8* %tmp, i32 %i ; [#uses=1]
8 %tmp.upgrd.1 = load i8* %tmp1 ; [#uses=1]
9 %tmp2 = zext i8 %tmp.upgrd.1 to i32 ; [#uses=1]
10 %tmp3 = load i32** @vals ; [#uses=1]
11 %tmp5 = sub i32 1, %tmp2 ; [#uses=1]
12 %tmp6 = getelementptr i32* %tmp3, i32 %tmp5 ; [#uses=1]
13 %tmp7 = load i32* %tmp6 ; [#uses=1]
14 ret i32 %tmp7
1515 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
0 ; RUN: llvm-as < %s | llc -march=ppc32
11
2 void %img2buf(int %symbol_size_in_bytes, ushort* %ui16) {
3 %tmp93 = load ushort* null ; [#uses=1]
4 %tmp99 = call ushort %llvm.bswap.i16( ushort %tmp93 ) ; [#uses=1]
5 store ushort %tmp99, ushort* %ui16
6 ret void
2 define void @img2buf(i32 %symbol_size_in_bytes, i16* %ui16) {
3 %tmp93 = load i16* null ; [#uses=1]
4 %tmp99 = call i16 @llvm.bswap.i16( i16 %tmp93 ) ; [#uses=1]
5 store i16 %tmp99, i16* %ui16
6 ret void
77 }
88
9 declare ushort %llvm.bswap.i16(ushort)
9 declare i16 @llvm.bswap.i16(i16)
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vsldoi
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vor
0 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vsldoi
1 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep vor
22
3 <4 x float> %func(<4 x float> %fp0, <4 x float> %fp1) {
4 %tmp76 = shufflevector <4 x float> %fp0, <4 x float> %fp1, <4 x uint> < uint 0, uint 1, uint 2, uint 7 > ; <<4 x float>> [#uses=1]
3 define <4 x float> @func(<4 x float> %fp0, <4 x float> %fp1) {
4 %tmp76 = shufflevector <4 x float> %fp0, <4 x float> %fp1, <4 x i32> < i32 0, i32 1, i32 2, i32 7 > ; <<4 x float>> [#uses=1]
55 ret <4 x float> %tmp76
66 }
77
None ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc
11
2 %struct..0anon = type { int }
3 %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct..0anon] }
2 %struct..0anon = type { i32 }
3 %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
44
5 implementation ; Functions:
6
7 fastcc void %immed_double_const(int %i0, int %i1) {
5 define fastcc void @immed_double_const(i32 %i0, i32 %i1) {
86 entry:
9 %tmp1 = load uint* null ; [#uses=1]
10 switch uint %tmp1, label %bb103 [
11 uint 1, label %bb
12 uint 3, label %bb
7 %tmp1 = load i32* null ; [#uses=1]
8 switch i32 %tmp1, label %bb103 [
9 i32 1, label %bb
10 i32 3, label %bb
1311 ]
14
1512 bb: ; preds = %entry, %entry
16 %tmp14 = setgt int 0, 31 ; [#uses=1]
17 br bool %tmp14, label %cond_next77, label %cond_next17
18
13 %tmp14 = icmp sgt i32 0, 31 ; [#uses=1]
14 br i1 %tmp14, label %cond_next77, label %cond_next17
1915 cond_next17: ; preds = %bb
2016 ret void
21
2217 cond_next77: ; preds = %bb
23 %tmp79.not = setne int %i1, 0 ; [#uses=1]
24 %tmp84 = setlt int %i0, 0 ; [#uses=2]
25 %bothcond1 = or bool %tmp79.not, %tmp84 ; [#uses=1]
26 br bool %bothcond1, label %bb88, label %bb99
27
18 %tmp79.not = icmp ne i32 %i1, 0 ; [#uses=1]
19 %tmp84 = icmp slt i32 %i0, 0 ; [#uses=2]
20 %bothcond1 = or i1 %tmp79.not, %tmp84 ; [#uses=1]
21 br i1 %bothcond1, label %bb88, label %bb99
2822 bb88: ; preds = %cond_next77
29 %bothcond2 = and bool false, %tmp84 ; > [#uses=0]
23 %bothcond2 = and i1 false, %tmp84 ; > [#uses=0]
3024 ret void
31
3225 bb99: ; preds = %cond_next77
3326 ret void
34
3527 bb103: ; preds = %entry
3628 ret void
3729 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
1 target endian = big
2 target pointersize = 64
0 ; RUN: llvm-as < %s | llc -march=ppc64
1
2 target datalayout = "E-p:64:64"
33 target triple = "powerpc64-apple-darwin8"
44
5 implementation ; Functions:
5 define void @glArrayElement_CompExec() {
6 entry:
7 %tmp3 = and i64 0, -8388609 ; [#uses=1]
8 br label %cond_true24
9 cond_false: ; preds = %cond_true24
10 ret void
11 cond_true24: ; preds = %cond_true24, %entry
12 %indvar.ph = phi i32 [ 0, %entry ], [ %indvar.next, %cond_true24 ] ; [#uses=1]
13 %indvar = add i32 0, %indvar.ph ; [#uses=2]
14 %code.0 = trunc i32 %indvar to i8 ; [#uses=1]
15 %tmp5 = add i8 %code.0, 16 ; [#uses=1]
16 %shift.upgrd.1 = zext i8 %tmp5 to i64 ; [#uses=1]
17 %tmp7 = lshr i64 %tmp3, %shift.upgrd.1 ; [#uses=1]
18 %tmp7.upgrd.2 = trunc i64 %tmp7 to i32 ; [#uses=1]
19 %tmp8 = and i32 %tmp7.upgrd.2, 1 ; [#uses=1]
20 %tmp8.upgrd.3 = icmp eq i32 %tmp8, 0 ; [#uses=1]
21 %indvar.next = add i32 %indvar, 1 ; [#uses=1]
22 br i1 %tmp8.upgrd.3, label %cond_false, label %cond_true24
23 }
624
7 void %glArrayElement_CompExec() {
8 entry:
9 %tmp3 = and ulong 0, 18446744073701163007 ; [#uses=1]
10 br label %cond_true24
11
12 cond_false: ; preds = %cond_true24
13 ret void
14
15 cond_true24: ; preds = %cond_true24, %entry
16 %indvar.ph = phi uint [ 0, %entry ], [ %indvar.next, %cond_true24 ] ; [#uses=1]
17 %indvar = add uint 0, %indvar.ph ; [#uses=2]
18 %code.0 = cast uint %indvar to ubyte ; [#uses=1]
19 %tmp5 = add ubyte %code.0, 16 ; [#uses=1]
20 %tmp7 = shr ulong %tmp3, ubyte %tmp5 ; [#uses=1]
21 %tmp7 = cast ulong %tmp7 to int ; [#uses=1]
22 %tmp8 = and int %tmp7, 1 ; [#uses=1]
23 %tmp8 = seteq int %tmp8, 0 ; [#uses=1]
24 %indvar.next = add uint %indvar, 1 ; [#uses=1]
25 br bool %tmp8, label %cond_false, label %cond_true24
26 }
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=ppc32 -combiner-alias-analysis | grep f5
22
3 target endian = big
4 target pointersize = 32
3 target datalayout = "E-p:32:32"
54 target triple = "powerpc-apple-darwin8.2.0"
6 %struct.Point = type { double, double, double }
5 %struct.Point = type { double, double, double }
76
8 implementation ; Functions:
7 define void @offset(%struct.Point* %pt, double %x, double %y, double %z) {
8 entry:
9 %tmp = getelementptr %struct.Point* %pt, i32 0, i32 0 ; [#uses=2]
10 %tmp.upgrd.1 = load double* %tmp ; [#uses=1]
11 %tmp2 = add double %tmp.upgrd.1, %x ; [#uses=1]
12 store double %tmp2, double* %tmp
13 %tmp6 = getelementptr %struct.Point* %pt, i32 0, i32 1 ; [#uses=2]
14 %tmp7 = load double* %tmp6 ; [#uses=1]
15 %tmp9 = add double %tmp7, %y ; [#uses=1]
16 store double %tmp9, double* %tmp6
17 %tmp13 = getelementptr %struct.Point* %pt, i32 0, i32 2 ; [#uses=2]
18 %tmp14 = load double* %tmp13 ; [#uses=1]
19 %tmp16 = add double %tmp14, %z ; [#uses=1]
20 store double %tmp16, double* %tmp13
21 ret void
22 }
923
10 void %offset(%struct.Point* %pt, double %x, double %y, double %z) {
11 entry:
12 %tmp = getelementptr %struct.Point* %pt, int 0, uint 0 ; [#uses=2]
13 %tmp = load double* %tmp ; [#uses=1]
14 %tmp2 = add double %tmp, %x ; [#uses=1]
15 store double %tmp2, double* %tmp
16 %tmp6 = getelementptr %struct.Point* %pt, int 0, uint 1 ; [#uses=2]
17 %tmp7 = load double* %tmp6 ; [#uses=1]
18 %tmp9 = add double %tmp7, %y ; [#uses=1]
19 store double %tmp9, double* %tmp6
20 %tmp13 = getelementptr %struct.Point* %pt, int 0, uint 2 ; [#uses=2]
21 %tmp14 = load double* %tmp13 ; [#uses=1]
22 %tmp16 = add double %tmp14, %z ; [#uses=1]
23 store double %tmp16, double* %tmp13
24 ret void
25 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep IMPLICIT_DEF
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep IMPLICIT_DEF
11
2 void %foo(long %X) {
2 define void @foo(i64 %X) {
33 entry:
4 %tmp1 = and long %X, 3 ; [#uses=1]
5 %tmp = setgt long %tmp1, 2 ; [#uses=1]
6 br bool %tmp, label %UnifiedReturnBlock, label %cond_true
7
4 %tmp1 = and i64 %X, 3 ; [#uses=1]
5 %tmp = icmp sgt i64 %tmp1, 2 ; [#uses=1]
6 br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
87 cond_true: ; preds = %entry
9 %tmp = tail call int (...)* %bar( ) ; > [#uses=0]
8 %tmp.upgrd.1 = tail call i32 (...)* @bar( ) ; > [#uses=0]
109 ret void
11
1210 UnifiedReturnBlock: ; preds = %entry
1311 ret void
1412 }
1513
16 declare int %bar(...)
14 declare i32 @bar(...)
1715
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep xor
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep xor
11
2 target endian = big
3 target pointersize = 32
2 target datalayout = "E-p:32:32"
43 target triple = "powerpc-apple-darwin8.7.0"
54
6 implementation ; Functions:
7
8 void %foo(int %X) {
5 define void @foo(i32 %X) {
96 entry:
10 %tmp1 = and int %X, 3 ; [#uses=1]
11 %tmp2 = xor int %tmp1, 1
12 %tmp = seteq int %tmp2, 0 ; [#uses=1]
13 br bool %tmp, label %UnifiedReturnBlock, label %cond_true
14
15 cond_true: ; preds = %entry
16 tail call int (...)* %bar( ) ; [#uses=0]
17 ret void
18
19 UnifiedReturnBlock: ; preds = %entry
20 ret void
7 %tmp1 = and i32 %X, 3 ; [#uses=1]
8 %tmp2 = xor i32 %tmp1, 1 ; [#uses=1]
9 %tmp = icmp eq i32 %tmp2, 0 ; [#uses=1]
10 br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
11 cond_true: ; preds = %entry
12 tail call i32 (...)* @bar( ) ; :0 [#uses=0]
13 ret void
14 UnifiedReturnBlock: ; preds = %entry
15 ret void
2116 }
2217
23 declare int %bar(...)
18 declare i32 @bar(...)
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
0 ; RUN: llvm-as < %s | llc -march=ppc64
11
2 int * %foo(uint %n) {
3 %A = alloca int, uint %n
4 ret int* %A
2 define i32* @foo(i32 %n) {
3 %A = alloca i32, i32 %n ; [#uses=1]
4 ret i32* %A
55 }
6
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi
11
2 void %test(short %div.0.i.i.i.i, int %L_num.0.i.i.i.i, int %tmp1.i.i206.i.i, short* %P) {
3 %X = shl short %div.0.i.i.i.i, ubyte 1 ; [#uses=1]
4 %tmp28.i.i.i.i = shl int %L_num.0.i.i.i.i, ubyte 1 ; [#uses=2]
5 %tmp31.i.i.i.i = setlt int %tmp28.i.i.i.i, %tmp1.i.i206.i.i ; [#uses=2]
6
7 %tmp31.i.i.i.i = cast bool %tmp31.i.i.i.i to short ; [#uses=1]
8 %tmp371.i.i.i.i1 = or short %tmp31.i.i.i.i, %X ; [#uses=1]
9 %div.0.be.i.i.i.i = xor short %tmp371.i.i.i.i1, 1 ; [#uses=1]
10 store short %div.0.be.i.i.i.i, short* %P
2 define void @test(i16 %div.0.i.i.i.i, i32 %L_num.0.i.i.i.i, i32 %tmp1.i.i206.i.i, i16* %P) {
3 %X = shl i16 %div.0.i.i.i.i, 1 ; [#uses=1]
4 %tmp28.i.i.i.i = shl i32 %L_num.0.i.i.i.i, 1 ; [#uses=1]
5 %tmp31.i.i.i.i = icmp slt i32 %tmp28.i.i.i.i, %tmp1.i.i206.i.i ; [#uses=1]
6 %tmp31.i.i.i.i.upgrd.1 = zext i1 %tmp31.i.i.i.i to i16 ; [#uses=1]
7 %tmp371.i.i.i.i1 = or i16 %tmp31.i.i.i.i.upgrd.1, %X ; [#uses=1]
8 %div.0.be.i.i.i.i = xor i16 %tmp371.i.i.i.i1, 1 ; [#uses=1]
9 store i16 %div.0.be.i.i.i.i, i16* %P
1110 ret void
1211 }
1312
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5
0 ; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5
11
2 void %glgRunProcessor15() {
3 %tmp26355.i = shufflevector <4 x float> zeroinitializer, <4 x float> < float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000 >, <4 x uint> < uint 0, uint 1, uint 2, uint 7 > ; <<4 x float>> [#uses=1]
4 %tmp3030030304.i = cast <4 x float> %tmp26355.i to <8 x short> ; <<8 x short>> [#uses=1]
5 %tmp30305.i = shufflevector <8 x short> zeroinitializer, <8 x short> %tmp3030030304.i, <8 x uint> < uint 1, uint 3, uint 5, uint 7, uint 9, uint 11, uint 13, uint 15 > ; <<8 x short>> [#uses=1]
6 %tmp30305.i = cast <8 x short> %tmp30305.i to <4 x int> ; <<4 x int>> [#uses=1]
7 store <4 x int> %tmp30305.i, <4 x int>* null
8 ret void
2 define void @glgRunProcessor15() {
3 %tmp26355.i = shufflevector <4 x float> zeroinitializer, <4 x float> < float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000, float 0x379FFFE000000000 >, <4 x i32> < i32 0, i32 1, i32 2, i32 7 >; <<4 x float>> [#uses=1]
4 %tmp3030030304.i = bitcast <4 x float> %tmp26355.i to <8 x i16> ; <<8 x i16>> [#uses=1]
5 %tmp30305.i = shufflevector <8 x i16> zeroinitializer, <8 x i16> %tmp3030030304.i, <8 x i32> < i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15 > ; <<8 x i16>> [#uses=1]
6 %tmp30305.i.upgrd.1 = bitcast <8 x i16> %tmp30305.i to <4 x i32> ; <<4 x i32>> [#uses=1]
7 store <4 x i32> %tmp30305.i.upgrd.1, <4 x i32>* null
8 ret void
99 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
2 ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc -march=ppc64
1 ; RUN: llvm-as < %s | llc -march=ppc32
2 ; RUN: llvm-as < %s | llc
33
4 void %bitap() {
4 define void @bitap() {
55 entry:
6 %RMask.i = alloca [256 x uint], align 16 ; <[256 x uint]*> [#uses=1]
7 %buffer = alloca [147456 x sbyte], align 16 ; <[147456 x sbyte]*> [#uses=0]
8 br bool false, label %bb19, label %bb.preheader
6 %RMask.i = alloca [256 x i32], align 16 ; <[256 x i32]*> [#uses=1]
7 %buffer = alloca [147456 x i8], align 16 ; <[147456 x i8]*> [#uses=0]
8 br i1 false, label %bb19, label %bb.preheader
9 bb.preheader: ; preds = %entry
10 ret void
11 bb19: ; preds = %entry
12 br i1 false, label %bb12.i, label %cond_next39
13 bb12.i: ; preds = %bb12.i, %bb19
14 %i.0.i = phi i32 [ %tmp11.i, %bb12.i ], [ 0, %bb19 ] ; [#uses=2]
15 %gep.upgrd.1 = zext i32 %i.0.i to i64 ; [#uses=1]
16 %tmp9.i = getelementptr [256 x i32]* %RMask.i, i32 0, i64 %gep.upgrd.1 ; [#uses=1]
17 store i32 0, i32* %tmp9.i
18 %tmp11.i = add i32 %i.0.i, 1 ; [#uses=1]
19 br label %bb12.i
20 cond_next39: ; preds = %bb19
21 ret void
22 }
923
10 bb.preheader: ; preds = %entry
11 ret void
12
13 bb19: ; preds = %entry
14 br bool false, label %bb12.i, label %cond_next39
15
16 bb12.i: ; preds = %bb12.i, %bb19
17 %i.0.i = phi uint [ %tmp11.i, %bb12.i ], [ 0, %bb19 ] ; [#uses=2]
18 %tmp9.i = getelementptr [256 x uint]* %RMask.i, int 0, uint %i.0.i ; [#uses=1]
19 store uint 0, uint* %tmp9.i
20 %tmp11.i = add uint %i.0.i, 1 ; [#uses=1]
21 br label %bb12.i
22
23 cond_next39: ; preds = %bb19
24 ret void
25 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32
2 ; RUN: llvm-upgrade < %s | llvm-as | llc
0 ; RUN: llvm-as < %s | llc -march=ppc64
1 ; RUN: llvm-as < %s | llc -march=ppc32
2 ; RUN: llvm-as < %s | llc
33
4 %qsz.b = external global bool ; *> [#uses=1]
4 @qsz.b = external global i1 ; *> [#uses=1]
55
6 implementation ; Functions:
6 define fastcc void @qst() {
7 entry:
8 br i1 true, label %cond_next71, label %cond_true
9 cond_true: ; preds = %entry
10 ret void
11 cond_next71: ; preds = %entry
12 %tmp73.b = load i1* @qsz.b ; [#uses=1]
13 %ii.4.ph = select i1 %tmp73.b, i64 4, i64 0 ; [#uses=1]
14 br label %bb139
15 bb82: ; preds = %bb139
16 ret void
17 bb139: ; preds = %bb139, %cond_next71
18 %exitcond89 = icmp eq i64 0, %ii.4.ph ; [#uses=1]
19 br i1 %exitcond89, label %bb82, label %bb139
20 }
721
8 fastcc void %qst() {
9 entry:
10 br bool true, label %cond_next71, label %cond_true
11
12 cond_true: ; preds = %entry
13 ret void
14
15 cond_next71: ; preds = %entry
16 %tmp73.b = load bool* %qsz.b ; [#uses=1]
17 %ii.4.ph = select bool %tmp73.b, ulong 4, ulong 0 ; [#uses=1]
18 br label %bb139
19
20 bb82: ; preds = %bb139
21 ret void
22
23 bb139: ; preds = %bb139, %cond_next71
24 %exitcond89 = seteq ulong 0, %ii.4.ph ; [#uses=1]
25 br bool %exitcond89, label %bb82, label %bb139
26 }
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
22 ; RUN: not grep {stw r31, 20(r1)}
3 ; RUN: llvm-upgrade < %s | llvm-as | \
3 ; RUN: llvm-as < %s | \
44 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep {lis r0, -1}
5 ; RUN: llvm-upgrade < %s | llvm-as | \
5 ; RUN: llvm-as < %s | \
66 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
77 ; RUN: grep {ori r0, r0, 32704}
8 ; RUN: llvm-upgrade < %s | llvm-as | \
8 ; RUN: llvm-as < %s | \
99 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1010 ; RUN: grep {stwux r1, r1, r0}
11 ; RUN: llvm-upgrade < %s | llvm-as | \
11 ; RUN: llvm-as < %s | \
1212 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1313 ; RUN: grep {lwz r1, 0(r1)}
14 ; RUN: llvm-upgrade < %s | llvm-as | \
14 ; RUN: llvm-as < %s | \
1515 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1616 ; RUN: not grep {lwz r31, 20(r1)}
17 ; RUN: llvm-upgrade < %s | llvm-as | \
17 ; RUN: llvm-as < %s | \
1818 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
1919 ; RUN: grep {stw r31, 20(r1)}
20 ; RUN: llvm-upgrade < %s | llvm-as | \
20 ; RUN: llvm-as < %s | \
2121 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
2222 ; RUN: grep {lis r0, -1}
23 ; RUN: llvm-upgrade < %s | llvm-as | \
23 ; RUN: llvm-as < %s | \
2424 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
2525 ; RUN: grep {ori r0, r0, 32704}
26 ; RUN: llvm-upgrade < %s | llvm-as | \
26 ; RUN: llvm-as < %s | \
2727 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
2828 ; RUN: grep {stwux r1, r1, r0}
29 ; RUN: llvm-upgrade < %s | llvm-as | \
29 ; RUN: llvm-as < %s | \
3030 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
3131 ; RUN: grep {lwz r1, 0(r1)}
32 ; RUN: llvm-upgrade < %s | llvm-as | \
32 ; RUN: llvm-as < %s | \
3333 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
3434 ; RUN: grep {lwz r31, 20(r1)}
35 ; RUN: llvm-upgrade < %s | llvm-as | \
35 ; RUN: llvm-as < %s | \
3636 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
3737 ; RUN: not grep {std r31, 40(r1)}
38 ; RUN: llvm-upgrade < %s | llvm-as | \
38 ; RUN: llvm-as < %s | \
3939 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
4040 ; RUN: grep {lis r0, -1}
41 ; RUN: llvm-upgrade < %s | llvm-as | \
41 ; RUN: llvm-as < %s | \
4242 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
4343 ; RUN: grep {ori r0, r0, 32656}
44 ; RUN: llvm-upgrade < %s | llvm-as | \
44 ; RUN: llvm-as < %s | \
4545 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
4646 ; RUN: grep {stdux r1, r1, r0}
47 ; RUN: llvm-upgrade < %s | llvm-as | \
47 ; RUN: llvm-as < %s | \
4848 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
4949 ; RUN: grep {ld r1, 0(r1)}
50 ; RUN: llvm-upgrade < %s | llvm-as | \
50 ; RUN: llvm-as < %s | \
5151 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | \
5252 ; RUN: not grep {ld r31, 40(r1)}
53 ; RUN: llvm-upgrade < %s | llvm-as | \
53 ; RUN: llvm-as < %s | \
5454 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
5555 ; RUN: grep {std r31, 40(r1)}
56 ; RUN: llvm-upgrade < %s | llvm-as | \
56 ; RUN: llvm-as < %s | \
5757 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
5858 ; RUN: grep {lis r0, -1}
59 ; RUN: llvm-upgrade < %s | llvm-as | \
59 ; RUN: llvm-as < %s | \
6060 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
6161 ; RUN: grep {ori r0, r0, 32656}
62 ; RUN: llvm-upgrade < %s | llvm-as | \
62 ; RUN: llvm-as < %s | \
6363 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
6464 ; RUN: grep {stdux r1, r1, r0}
65 ; RUN: llvm-upgrade < %s | llvm-as | \
65 ; RUN: llvm-as < %s | \
6666 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
6767 ; RUN: grep {ld r1, 0(r1)}
68 ; RUN: llvm-upgrade < %s | llvm-as | \
68 ; RUN: llvm-as < %s | \
6969 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim | \
7070 ; RUN: grep {ld r31, 40(r1)}
7171
72 define i32* @f1() {
73 %tmp = alloca i32, i32 8191 ; [#uses=1]
74 ret i32* %tmp
75 }
7276
73 implementation
74
75 int* %f1() {
76 %tmp = alloca int, uint 8191
77 ret int* %tmp
78 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
0 ; RUN: llvm-as < %s | llc -march=ppc32 | \
11 ; RUN: not grep {stw r31, 20(r1)}
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: llvm-as < %s | llc -march=ppc32 | \
33 ; RUN: not grep {stwu r1, -.*(r1)}
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
4 ; RUN: llvm-as < %s | llc -march=ppc32 | \
55 ; RUN: not grep {addi r1, r1, }
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
6 ; RUN: llvm-as < %s | llc -march=ppc32 | \
77 ; RUN: not grep {lwz r31, 20(r1)}
8 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -disable-fp-elim | \
8 ; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
99 ; RUN: not grep {stw r31, 20(r1)}
10 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -disable-fp-elim | \
10 ; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
1111 ; RUN: not grep {stwu r1, -.*(r1)}
12 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -disable-fp-elim | \
12 ; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
1313 ; RUN: not grep {addi r1, r1, }
14 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -disable-fp-elim | \
14 ; RUN: llvm-as < %s | llc -march=ppc32 -disable-fp-elim | \
1515 ; RUN: not grep {lwz r31, 20(r1)}
16 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
16 ; RUN: llvm-as < %s | llc -march=ppc64 | \
1717 ; RUN: not grep {std r31, 40(r1)}
18 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
18 ; RUN: llvm-as < %s | llc -march=ppc64 | \
1919 ; RUN: not grep {stdu r1, -.*(r1)}
20 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
20 ; RUN: llvm-as < %s | llc -march=ppc64 | \
2121 ; RUN: not grep {addi r1, r1, }
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
22 ; RUN: llvm-as < %s | llc -march=ppc64 | \
2323 ; RUN: not grep {ld r31, 40(r1)}
24 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -disable-fp-elim | \
24 ; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
2525 ; RUN: not grep {stw r31, 40(r1)}
26 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -disable-fp-elim | \
26 ; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
2727 ; RUN: not grep {stdu r1, -.*(r1)}
28 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -disable-fp-elim | \
28 ; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
2929 ; RUN: not grep {addi r1, r1, }
30 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -disable-fp-elim | \
30 ; RUN: llvm-as < %s | llc -march=ppc64 -disable-fp-elim | \
3131 ; RUN: not grep {ld r31, 40(r1)}
3232
33
34 implementation
35
36 int* %f1() {
37 %tmp = alloca int, uint 2
38 ret int* %tmp
33 define i32* @f1() {
34 %tmp = alloca i32, i32 2 ; [#uses=1]
35 ret i32* %tmp
3936 }
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1 -f
22 ; RUN not grep {stw r31, 20(r1)} %t1
33 ; RUN: grep {stwu r1, -16448(r1)} %t1
44 ; RUN: grep {addi r1, r1, 16448} %t1
5 ; RUN: llvm-upgrade < %s | llvm-as | \
5 ; RUN: llvm-as < %s | \
66 ; RUN: not grep {lwz r31, 20(r1)}
7 ; RUN: llvm-upgrade < %s | llvm-as | \
7 ; RUN: llvm-as < %s | \
88 ; RUN: llc -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
99 ; RUN: -o %t2 -f
1010 ; RUN: grep {stw r31, 20(r1)} %t2
1111 ; RUN: grep {stwu r1, -16448(r1)} %t2
1212 ; RUN: grep {addi r1, r1, 16448} %t2
1313 ; RUN: grep {lwz r31, 20(r1)} %t2
14 ; RUN: llvm-upgrade < %s | llvm-as | \
14 ; RUN: llvm-as < %s | \
1515 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3 -f
1616 ; RUN: not grep {std r31, 40(r1)} %t3
1717 ; RUN: grep {stdu r1, -16496(r1)} %t3
1818 ; RUN: grep {addi r1, r1, 16496} %t3
1919 ; RUN: not grep {ld r31, 40(r1)} %t3
20 ; RUN: llvm-upgrade < %s | llvm-as | \
20 ; RUN: llvm-as < %s | \
2121 ; RUN: llc -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
2222 ; RUN: -o %t4 -f
2323 ; RUN: grep {std r31, 40(r1)} %t4
2525 ; RUN: grep {addi r1, r1, 16496} %t4
2626 ; RUN: grep {ld r31, 40(r1)} %t4
2727
28 implementation
28 define i32* @f1() {
29 %tmp = alloca i32, i32 4095 ; [#uses=1]
30 ret i32* %tmp
31 }
2932
30 int* %f1() {
31 %tmp = alloca int, uint 4095
32 ret int* %tmp
33 }
0 ; All of these should be codegen'd without loading immediates
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
1 ; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
22 ; RUN: grep addc %t | count 1
33 ; RUN: grep adde %t | count 1
44 ; RUN: grep addze %t | count 1
55 ; RUN: grep addme %t | count 1
66 ; RUN: grep addic %t | count 2
77
8 implementation ; Functions:
9
10 long %add_ll(long %a, long %b) {
8 define i64 @add_ll(i64 %a, i64 %b) {
119 entry:
12 %tmp.2 = add long %b, %a ; [#uses=1]
13 ret long %tmp.2
10 %tmp.2 = add i64 %b, %a ; [#uses=1]
11 ret i64 %tmp.2
1412 }
1513
16 long %add_l_5(long %a) {
14 define i64 @add_l_5(i64 %a) {
1715 entry:
18 %tmp.1 = add long %a, 5 ; [#uses=1]
19 ret long %tmp.1
16 %tmp.1 = add i64 %a, 5 ; [#uses=1]
17 ret i64 %tmp.1
2018 }
2119
22 long %add_l_m5(long %a) {
20 define i64 @add_l_m5(i64 %a) {
2321 entry:
24 %tmp.1 = add long %a, -5 ; [#uses=1]
25 ret long %tmp.1
22 %tmp.1 = add i64 %a, -5 ; [#uses=1]
23 ret i64 %tmp.1
2624 }
25
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep addi
11
2 %struct.X = type { [5 x sbyte] }
3 implementation ; Functions:
2 %struct.X = type { [5 x i8] }
43
5 int %test1([4 x int]* %P, int %i) {
6 %tmp.2 = add int %i, 2 ; [#uses=1]
7 %tmp.4 = getelementptr [4 x int]* %P, int %tmp.2, int 1
8 %tmp.5 = load int* %tmp.4
9 ret int %tmp.5
4 define i32 @test1([4 x i32]* %P, i32 %i) {
5 %tmp.2 = add i32 %i, 2 ; [#uses=1]
6 %tmp.4 = getelementptr [4 x i32]* %P, i32 %tmp.2, i32 1 ; [#uses=1]
7 %tmp.5 = load i32* %tmp.4 ; [#uses=1]
8 ret i32 %tmp.5
109 }
1110
12 int %test2(%struct.X* %P, int %i) {
13 %tmp.2 = add int %i, 2
14 %tmp.5 = getelementptr %struct.X* %P, int %tmp.2, uint 0, int 1
15 %tmp.6 = load sbyte* %tmp.5
16 %tmp.7 = cast sbyte %tmp.6 to int
17 ret int %tmp.7
11 define i32 @test2(%struct.X* %P, i32 %i) {
12 %tmp.2 = add i32 %i, 2 ; [#uses=1]
13 %tmp.5 = getelementptr %struct.X* %P, i32 %tmp.2, i32 0, i32 1 ; [#uses=1]
14 %tmp.6 = load i8* %tmp.5 ; [#uses=1]
15 %tmp.7 = sext i8 %tmp.6 to i32 ; [#uses=1]
16 ret i32 %tmp.7
1817 }
1918
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
0 ; RUN: llvm-as < %s | llc -march=ppc32 | \
11 ; RUN: grep align.4 | count 1
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: llvm-as < %s | llc -march=ppc32 | \
33 ; RUN: grep align.2 | count 1
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
4 ; RUN: llvm-as < %s | llc -march=ppc32 | \
55 ; RUN: grep align.3 | count 1
66
7 @A = global <4 x i32> < i32 10, i32 20, i32 30, i32 40 > ; <<4 x i32>*> [#uses=0]
8 @B = global float 1.000000e+02 ; [#uses=0]
9 @C = global double 2.000000e+03 ; [#uses=0]
710
8 %A = global <4 x uint> < uint 10, uint 20, uint 30, uint 40 >
9 %B = global float 1.000000e+02
10 %C = global double 2.000000e+03
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep mfcr
11
2 void %foo(int %X, int %Y, int %Z) {
2 define void @foo(i32 %X, i32 %Y, i32 %Z) {
33 entry:
4 %tmp = seteq int %X, 0 ; [#uses=1]
5 %tmp3 = setlt int %Y, 5 ; [#uses=1]
6 %tmp4 = and bool %tmp3, %tmp ; [#uses=1]
7 br bool %tmp4, label %cond_true, label %UnifiedReturnBlock
8
9 cond_true: ; preds = %entry
10 %tmp5 = tail call int (...)* %bar( ) ; [#uses=0]
11 ret void
12
13 UnifiedReturnBlock: ; preds = %entry
14 ret void
4 %tmp = icmp eq i32 %X, 0 ; [#uses=1]
5 %tmp3 = icmp slt i32 %Y, 5 ; [#uses=1]
6 %tmp4 = and i1 %tmp3, %tmp ; [#uses=1]
7 br i1 %tmp4, label %cond_true, label %UnifiedReturnBlock
8 cond_true: ; preds = %entry
9 %tmp5 = tail call i32 (...)* @bar( ) ; [#uses=0]
10 ret void
11 UnifiedReturnBlock: ; preds = %entry
12 ret void
1513 }
1614
17 declare int %bar(...)
15 declare i32 @bar(...)
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep {ori\\|lis}
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep {ori\\|lis}
11
2 int %test(int %X) {
3 %Y = and int %X, 32769 ; andi. r3, r3, 32769
4 ret int %Y
2 ; andi. r3, r3, 32769
3 define i32 @test(i32 %X) {
4 %Y = and i32 %X, 32769 ; [#uses=1]
5 ret i32 %Y
56 }
67
7 int %test2(int %X) {
8 %Y = and int %X, -2147418112 ; andis. r3, r3, 32769
9 ret int %Y
8 ; andis. r3, r3, 32769
9 define i32 @test2(i32 %X) {
10 %Y = and i32 %X, -2147418112 ; [#uses=1]
11 ret i32 %Y
1012 }
1113
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
0 ; RUN: llvm-as < %s | llc -march=ppc32 -o %t -f
11 ; RUN: grep slwi %t
22 ; RUN: not grep addi %t
33 ; RUN: not grep rlwinm %t
44
5 int %test(int %A) {
6 %B = mul int %A, 8 ;; shift
7 %C = add int %B, 7 ;; dead, no demanded bits.
8 %D = and int %C, -8 ;; dead once add is gone.
9 ret int %D
5 define i32 @test(i32 %A) {
6 ;; shift
7 %B = mul i32 %A, 8 ; [#uses=1]
8 ;; dead, no demanded bits.
9 %C = add i32 %B, 7 ; [#uses=1]
10 ;; dead once add is gone.
11 %D = and i32 %C, -8 ; [#uses=1]
12 ret i32 %D
1013 }
1114
0 ; Neither of these functions should contain algebraic right shifts
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep srawi
1 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep srawi
22
3 int %test1(uint %mode.0.i.0) {
4 %tmp.79 = cast uint %mode.0.i.0 to int ; [#uses=1]
5 %tmp.80 = shr int %tmp.79, ubyte 15 ; [#uses=1]
6 %tmp.81 = and int %tmp.80, 24 ; [#uses=1]
7 ret int %tmp.81
3 define i32 @test1(i32 %mode.0.i.0) {
4 %tmp.79 = bitcast i32 %mode.0.i.0 to i32 ; [#uses=1]
5 %tmp.80 = ashr i32 %tmp.79, 15 ; [#uses=1]
6 %tmp.81 = and i32 %tmp.80, 24 ; [#uses=1]
7 ret i32 %tmp.81
88 }
99
10 int %test2(uint %mode.0.i.0) {
11 %tmp.79 = cast uint %mode.0.i.0 to int ; [#uses=1]
12 %tmp.80 = shr int %tmp.79, ubyte 15 ; [#uses=1]
13 %tmp.81 = shr uint %mode.0.i.0, ubyte 16
14 %tmp.82 = cast uint %tmp.81 to int
15 %tmp.83 = and int %tmp.80, %tmp.82 ; [#uses=1]
16 ret int %tmp.83
10 define i32 @test2(i32 %mode.0.i.0) {
11 %tmp.79 = bitcast i32 %mode.0.i.0 to i32 ; [#uses=1]
12 %tmp.80 = ashr i32 %tmp.79, 15 ; [#uses=1]
13 %tmp.81 = lshr i32 %mode.0.i.0, 16 ; [#uses=1]
14 %tmp.82 = bitcast i32 %tmp.81 to i32 ; [#uses=1]
15 %tmp.83 = and i32 %tmp.80, %tmp.82 ; [#uses=1]
16 ret i32 %tmp.83
1717 }
1818
19 uint %test3(int %specbits.6.1) {
20 %tmp.2540 = shr int %specbits.6.1, ubyte 11 ; [#uses=1]
21 %tmp.2541 = cast int %tmp.2540 to uint ; [#uses=1]
22 %tmp.2542 = shl uint %tmp.2541, ubyte 13 ; [#uses=1]
23 %tmp.2543 = and uint %tmp.2542, 8192 ; [#uses=1]
24 ret uint %tmp.2543
19 define i32 @test3(i32 %specbits.6.1) {
20 %tmp.2540 = ashr i32 %specbits.6.1, 11 ; [#uses=1]
21 %tmp.2541 = bitcast i32 %tmp.2540 to i32 ; [#uses=1]
22 %tmp.2542 = shl i32 %tmp.2541, 13 ; [#uses=1]
23 %tmp.2543 = and i32 %tmp.2542, 8192 ; [#uses=1]
24 ret i32 %tmp.2543
2525 }
26
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
0 ; RUN: llvm-as < %s | llc -march=ppc32 | \
11 ; RUN: grep {b LBB.*} | count 4
22
3 target endian = big
4 target pointersize = 32
3 target datalayout = "E-p:32:32"
54 target triple = "powerpc-apple-darwin8.7.0"
65
7 implementation ; Functions:
8
9 void %foo(int %W, int %X, int %Y, int %Z) {
6 define void @foo(i32 %W, i32 %X, i32 %Y, i32 %Z) {
107 entry:
11 %X = cast int %X to uint ; [#uses=1]
12 %Y = cast int %Y to uint ; [#uses=1]
13 %Z = cast int %Z to uint ; [#uses=1]
14 %W = cast int %W to uint ; [#uses=1]
15 %tmp1 = and int %W, 1 ; [#uses=1]
16 %tmp1 = seteq int %tmp1, 0 ; [#uses=1]
17 br bool %tmp1, label %cond_false, label %bb5
18
8 %tmp1 = and i32 %W, 1 ; [#uses=1]
9 %tmp1.upgrd.1 = icmp eq i32 %tmp1, 0 ; [#uses=1]
10 br i1 %tmp1.upgrd.1, label %cond_false, label %bb5
1911 bb: ; preds = %bb5, %bb
20 %indvar77 = phi uint [ %indvar.next78, %bb ], [ 0, %bb5 ] ; [#uses=1]
21 %tmp2 = tail call int (...)* %bar( ) ; [#uses=0]
22 %indvar.next78 = add uint %indvar77, 1 ; [#uses=2]
23 %exitcond79 = seteq uint %indvar.next78, %X ; [#uses=1]
24 br bool %exitcond79, label %cond_next48, label %bb
25
12 %indvar77 = phi i32 [ %indvar.next78, %bb ], [ 0, %bb5 ] ; [#uses=1]
13 %tmp2 = tail call i32 (...)* @bar( ) ; [#uses=0]
14 %indvar.next78 = add i32 %indvar77, 1 ; [#uses=2]
15 %exitcond79 = icmp eq i32 %indvar.next78, %X ; [#uses=1]
16 br i1 %exitcond79, label %cond_next48, label %bb
2617 bb5: ; preds = %entry
27 %tmp = seteq int %X, 0 ; [#uses=1]
28 br bool %tmp, label %cond_next48, label %bb
29
18 %tmp = icmp eq i32 %X, 0 ; [#uses=1]
19 br i1 %tmp, label %cond_next48, label %bb
3020 cond_false: ; preds = %entry
31 %tmp10 = and int %W, 2 ; [#uses=1]
32 %tmp10 = seteq int %tmp10, 0 ; [#uses=1]
33 br bool %tmp10, label %cond_false20, label %bb16
34
21 %tmp10 = and i32 %W, 2 ; [#uses=1]
22 %tmp10.upgrd.2 = icmp eq i32 %tmp10, 0 ; [#uses=1]
23 br i1 %tmp10.upgrd.2, label %cond_false20, label %bb16
3524 bb12: ; preds = %bb16, %bb12
36 %indvar72 = phi uint [ %indvar.next73, %bb12 ], [ 0, %bb16 ] ; [#uses=1]
37 %tmp13 = tail call int (...)* %bar( ) ; [#uses=0]
38 %indvar.next73 = add uint %indvar72, 1 ; [#uses=2]
39 %exitcond74 = seteq uint %indvar.next73, %Y ; [#uses=1]
40 br bool %exitcond74, label %cond_next48, label %bb12
41
25 %indvar72 = phi i32 [ %indvar.next73, %bb12 ], [ 0, %bb16 ] ; [#uses=1]
26 %tmp13 = tail call i32 (...)* @bar( ) ; [#uses=0]
27 %indvar.next73 = add i32 %indvar72, 1 ; [#uses=2]
28 %exitcond74 = icmp eq i32 %indvar.next73, %Y ; [#uses=1]
29 br i1 %exitcond74, label %cond_next48, label %bb12
4230 bb16: ; preds = %cond_false
43 %tmp18 = seteq int %Y, 0 ; [#uses=1]
44 br bool %tmp18, label %cond_next48, label %bb12
45
31 %tmp18 = icmp eq i32 %Y, 0 ; [#uses=1]
32 br i1 %tmp18, label %cond_next48, label %bb12
4633 cond_false20: ; preds = %cond_false
47 %tmp23 = and int %W, 4 ; [#uses=1]
48 %tmp23 = seteq int %tmp23, 0 ; [#uses=1]
49 br bool %tmp23, label %cond_false33, label %bb29
50
34 %tmp23 = and i32 %W, 4 ; [#uses=1]
35 %tmp23.upgrd.3 = icmp eq i32 %tmp23, 0 ; [#uses=1]
36 br i1 %tmp23.upgrd.3, label %cond_false33, label %bb29
5137 bb25: ; preds = %bb29, %bb25
52 %indvar67 = phi uint [ %indvar.next68, %bb25 ], [ 0, %bb29 ] ; [#uses=1]
53 %tmp26 = tail call int (...)* %bar( ) ; [#uses=0]
54 %indvar.next68 = add uint %indvar67, 1 ; [#uses=2]
55 %exitcond69 = seteq uint %indvar.next68, %Z ; [#uses=1]
56 br bool %exitcond69, label %cond_next48, label %bb25
57
38 %indvar67 = phi i32 [ %indvar.next68, %bb25 ], [ 0, %bb29 ] ; [#uses=1]
39 %tmp26 = tail call i32 (...)* @bar( ) ; [#uses=0]
40 %indvar.next68 = add i32 %indvar67, 1 ; [#uses=2]
41 %exitcond69 = icmp eq i32 %indvar.next68, %Z ; [#uses=1]
42 br i1 %exitcond69, label %cond_next48, label %bb25
5843 bb29: ; preds = %cond_false20
59 %tmp31 = seteq int %Z, 0 ; [#uses=1]
60 br bool %tmp31, label %cond_next48, label %bb25
61
44 %tmp31 = icmp eq i32 %Z, 0 ; [#uses=1]
45 br i1 %tmp31, label %cond_next48, label %bb25
6246 cond_false33: ; preds = %cond_false20
63 %tmp36 = and int %W, 8 ; [#uses=1]
64 %tmp36 = seteq int %tmp36, 0 ; [#uses=1]
65 br bool %tmp36, label %cond_next48, label %bb42
66
47 %tmp36 = and i32 %W, 8 ; [#uses=1]
48 %tmp36.upgrd.4 = icmp eq i32 %tmp36, 0 ; [#uses=1]
49 br i1 %tmp36.upgrd.4, label %cond_next48, label %bb42
6750 bb38: ; preds = %bb42
68 %tmp39 = tail call int (...)* %bar( ) ; [#uses=0]
69 %indvar.next = add uint %indvar, 1 ; [#uses=1]
51 %tmp39 = tail call i32 (...)* @bar( ) ; [#uses=0]
52 %indvar.next = add i32 %indvar, 1 ; [#uses=1]
7053 br label %bb42
71
72 bb42: ; preds = %cond_false33, %bb38
73 %indvar = phi uint [ %indvar.next, %bb38 ], [ 0, %cond_false33 ] ; [#uses=3]
74 %indvar = cast uint %indvar to int ; [#uses=1]
75 %W_addr.0 = sub int %W, %indvar ; [#uses=1]
76 %exitcond = seteq uint %indvar, %W ; [#uses=1]
77 br bool %exitcond, label %cond_next48, label %bb38
78
79 cond_next48: ; preds = %bb, %bb12, %bb25, %bb42, %cond_false33, %bb29, %bb16, %bb5
80 %W_addr.1 = phi int [ %W, %bb5 ], [ %W, %bb16 ], [ %W, %bb29 ], [ %W, %cond_false33 ], [ %W_addr.0, %bb42 ], [ %W, %bb25 ], [ %W, %bb12 ], [ %W, %bb ] ; [#uses=1]
81 %tmp50 = seteq int %W_addr.1, 0 ; [#uses=1]
82 br bool %tmp50, label %UnifiedReturnBlock, label %cond_true51
83
54 bb42: ; preds = %bb38, %cond_false33
55 %indvar = phi i32 [ %indvar.next, %bb38 ], [ 0, %cond_false33 ] ; [#uses=4]
56 %W_addr.0 = sub i32 %W, %indvar ; [#uses=1]
57 %exitcond = icmp eq i32 %indvar, %W ; [#uses=1]
58 br i1 %exitcond, label %cond_next48, label %bb38
59 cond_next48: ; preds = %bb42, %cond_false33, %bb29, %bb25, %bb16, %bb12, %bb5, %bb
60 %W_addr.1 = phi i32 [ %W, %bb5 ], [ %W, %bb16 ], [ %W, %bb29 ], [ %W, %cond_false33 ], [ %W_addr.0, %bb42 ], [ %W, %bb25 ], [ %W, %bb12 ], [ %W, %bb ] ; [#uses=1]
61 %tmp50 = icmp eq i32 %W_addr.1, 0 ; [#uses=1]
62 br i1 %tmp50, label %UnifiedReturnBlock, label %cond_true51
8463 cond_true51: ; preds = %cond_next48
85 %tmp52 = tail call int (...)* %bar( ) ; > [#uses=0]
64 %tmp52 = tail call i32 (...)* @bar( ) ; > [#uses=0]
8665 ret void
87
8866 UnifiedReturnBlock: ; preds = %cond_next48
8967 ret void
9068 }
9169
92 declare int %bar(...)
70 declare i32 @bar(...)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
0 ; RUN: llvm-as < %s | llc -march=ppc32 | \
11 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwimi
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
2 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwinm
3 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwimi
4 ; RUN: llvm-as < %s | llc -march=ppc64 | \
55 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwinm
7 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwimi
6 ; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwinm
7 ; RUN: llvm-as < %s | llc -march=ppc64 | not grep rlwimi
88
9 void %STWBRX(uint %i, sbyte* %ptr, int %off) {
10 %tmp1 = getelementptr sbyte* %ptr, int %off
11 %tmp1 = cast sbyte* %tmp1 to uint*
12 %tmp13 = tail call uint %llvm.bswap.i32(uint %i)
13 store uint %tmp13, uint* %tmp1
14 ret void
9 define void @STWBRX(i32 %i, i8* %ptr, i32 %off) {
10 %tmp1 = getelementptr i8* %ptr, i32 %off ; [#uses=1]
11 %tmp1.upgrd.1 = bitcast i8* %tmp1 to i32* ; [#uses=1]
12 %tmp13 = tail call i32 @llvm.bswap.i32( i32 %i ) ; [#uses=1]
13 store i32 %tmp13, i32* %tmp1.upgrd.1
14 ret void
1515 }
1616
17 uint %LWBRX(sbyte* %ptr, int %off) {
18 %tmp1 = getelementptr sbyte* %ptr, int %off
19 %tmp1 = cast sbyte* %tmp1 to uint*
20 %tmp = load uint* %tmp1
21 %tmp14 = tail call uint %llvm.bswap.i32( uint %tmp )
22 ret uint %tmp14
17 define i32 @LWBRX(i8* %ptr, i32 %off) {
18 %tmp1 = getelementptr i8* %ptr, i32 %off ; [#uses=1]
19 %tmp1.upgrd.2 = bitcast i8* %tmp1 to i32* ; [#uses=1]
20 %tmp = load i32* %tmp1.upgrd.2 ; [#uses=1]
21 %tmp14 = tail call i32 @llvm.bswap.i32( i32 %tmp ) ; [#uses=1]
22 ret i32 %tmp14
2323 }
2424
25 void %STHBRX(ushort %s, sbyte* %ptr, int %off) {
26 %tmp1 = getelementptr sbyte* %ptr, int %off
27 %tmp1 = cast sbyte* %tmp1 to ushort*
28 %tmp5 = call ushort %llvm.bswap.i16( ushort %s )
29 store ushort %tmp5, ushort* %tmp1
30 ret void
25 define void @STHBRX(i16 %s, i8* %ptr, i32 %off) {
26 %tmp1 = getelementptr i8* %ptr, i32 %off ; [#uses=1]
27 %tmp1.upgrd.3 = bitcast i8* %tmp1 to i16* ; [#uses=1]
28 %tmp5 = call i16 @llvm.bswap.i16( i16 %s ) ; [#uses=1]
29 store i16 %tmp5, i16* %tmp1.upgrd.3
30 ret void
3131 }
3232
33 ushort %LHBRX(sbyte* %ptr, int %off) {
34 %tmp1 = getelementptr sbyte* %ptr, int %off
35 %tmp1 = cast sbyte* %tmp1 to ushort*
36 %tmp = load ushort* %tmp1
37 %tmp6 = call ushort %llvm.bswap.i16(ushort %tmp)
38 ret ushort %tmp6
33 define i16 @LHBRX(i8* %ptr, i32 %off) {
34 %tmp1 = getelementptr i8* %ptr, i32 %off ; [#uses=1]
35 %tmp1.upgrd.4 = bitcast i8* %tmp1 to i16* ; [#uses=1]
36 %tmp = load i16* %tmp1.upgrd.4 ; [#uses=1]
37 %tmp6 = call i16 @llvm.bswap.i16( i16 %tmp ) ; [#uses=1]
38 ret i16 %tmp6
3939 }
4040
41 declare uint %llvm.bswap.i32(uint)
41 declare i32 @llvm.bswap.i32(i32)
4242
43 declare ushort %llvm.bswap.i16(ushort)
43 declare i16 @llvm.bswap.i16(i16)
44
0 ; There should be exactly one vxor here.
1 ; RUN: llvm-upgrade < %s | llvm-as | \
1 ; RUN: llvm-as < %s | \
22 ; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
33 ; RUN: grep vxor | count 1
44
55 ; There should be exactly one vsplti here.
6 ; RUN: llvm-upgrade < %s | llvm-as | \
6 ; RUN: llvm-as < %s | \
77 ; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
88 ; RUN: grep vsplti | count 1
99
10
11 void %VXOR(<4 x float>* %P1, <4 x int>* %P2, <4 x float>* %P3) {
12 %tmp = load <4 x float>* %P3
13 %tmp3 = load <4 x float>* %P1
14 %tmp4 = mul <4 x float> %tmp, %tmp3
10 define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
11 %tmp = load <4 x float>* %P3 ; <<4 x float>> [#uses=1]
12 %tmp3 = load <4 x float>* %P1 ; <<4 x float>> [#uses=1]
13 %tmp4 = mul <4 x float> %tmp, %tmp3 ; <<4 x float>> [#uses=1]
1514 store <4 x float> %tmp4, <4 x float>* %P3
1615 store <4 x float> zeroinitializer, <4 x float>* %P1
17 store <4 x int> zeroinitializer, <4 x int>* %P2
16 store <4 x i32> zeroinitializer, <4 x i32>* %P2
1817 ret void
1918 }
2019
21 void %VSPLTI(<4 x int>* %P2, <8 x short>* %P3) {
22 store <4 x int> cast (<16 x sbyte> < sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1, sbyte -1 > to <4 x int>), <4 x int>* %P2
23 store <8 x short> < short -1, short -1, short -1, short -1, short -1, short -1, short -1, short -1 >, <8 x short>* %P3
20 define void @VSPLTI(<4 x i32>* %P2, <8 x i16>* %P3) {
21 store <4 x i32> bitcast (<16 x i8> < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1 > to <4 x i32>), <4 x i32>* %P2
22 store <8 x i16> < i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1 >, <8 x i16>* %P3
2423 ret void
2524 }
2625
0 ; Test various forms of calls.
11
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: llvm-as < %s | llc -march=ppc32 | \
33 ; RUN: grep {bl } | count 2
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
4 ; RUN: llvm-as < %s | llc -march=ppc32 | \
55 ; RUN: grep {bctrl} | count 1
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
6 ; RUN: llvm-as < %s | llc -march=ppc32 | \
77 ; RUN: grep {bla } | count 1
88
9 declare void %foo()
9 declare void @foo()
1010
11 void %test_direct() {
12 call void %foo()
13 ret void
11 define void @test_direct() {
12 call void @foo( )
13 ret void
1414 }
1515
16 void %test_extsym(sbyte *%P) {
17 free sbyte* %P
18 ret void
16 define void @test_extsym(i8* %P) {
17 free i8* %P
18 ret void
1919 }
2020
21 void %test_indirect(void()* %fp) {
22 call void %fp()
23 ret void
21 define void @test_indirect(void ()* %fp) {
22 call void %fp( )
23 ret void
2424 }
2525
26 void %test_abs() {
27 %fp = cast int 400 to void()*
28 call void %fp()
29 ret void
26 define void @test_abs() {
27 %fp = inttoptr i32 400 to void ()* ; [#uses=1]
28 call void %fp( )
29 ret void
3030 }
31
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep mfcr
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep mfcr
11
2 void %test(long %X) {
3 %tmp1 = and long %X, 3 ; [#uses=1]
4 %tmp = setgt long %tmp1, 2 ; [#uses=1]
5 br bool %tmp, label %UnifiedReturnBlock, label %cond_true
6
7 cond_true: ; preds = %entry
8 tail call void %test(long 0)
2 define void @test(i64 %X) {
3 %tmp1 = and i64 %X, 3 ; [#uses=1]
4 %tmp = icmp sgt i64 %tmp1, 2 ; [#uses=1]
5 br i1 %tmp, label %UnifiedReturnBlock, label %cond_true
6 cond_true: ; preds = %0
7 tail call void @test( i64 0 )
98 ret void
10
11 UnifiedReturnBlock: ; preds = %entry
9 UnifiedReturnBlock: ; preds = %0
1210 ret void
1311 }
1412
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -regalloc=simple
0 ; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple
11
2 int %main() {
3 %A = add int 0, 0 ; %A = 0
4 %B = add int 0, 1 ; %B = 1
2 define i32 @main() {
3 ; %A = 0
4 %A = add i32 0, 0 ; [#uses=1]
5 ; %B = 1
6 %B = add i32 0, 1 ; [#uses=2]
57 br label %bb1
6 bb1:
7 %X = mul int %A, %B ; %X = 0*1 = 0
8 %R = sub int %B, 1 ; %r = 0
9 ret int %R
8 bb1: ; preds = %0
9 ; %X = 0*1 = 0
10 %X = mul i32 %A, %B ; [#uses=0]
11 ; %r = 0
12 %R = sub i32 %B, 1 ; [#uses=1]
13 ret i32 %R
1014 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -regalloc=simple
0 ; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple
11
2 int %main(int %B) {
3 ;%B = add int 0, 1
4 %R = sub int %B, 1 ; %r = 0
5 ret int %R
2 define i32 @main(i32 %B) {
3 ;%B = add i32 0, 1;
4 %R = sub i32 %B, 1 ; %r = 0
5 ret i32 %R
66 }
22 ; it makes a ton of annoying overlapping live ranges. This code should not
33 ; cause spills!
44 ;
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& not grep spilled
5 ; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep spilled
66
7 target endian = little
8 target pointersize = 32
7 target datalayout = "e-p:32:32"
98
10 int %test(int, int, int, int, int, int, int, int, int, int) { ret int 0 }
11 int %main() {
12 %X = call int %test(int 1, int 2, int 3, int 4, int 5, int 6, int 7, int 8, int 9, int 10)
13 ret int %X
9 define i32 @test(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) {
10 ret i32 0
1411 }
12
13 define i32 @main() {
14 %X = call i32 @test( i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ) ; [#uses=1]
15 ret i32 %X
16 }
17
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 implementation
3
4 int %test() {
5 entry: ret int 7
6 Test: ; dead block!
7 %A = call int %test()
8 %B = call int %test()
9 %C = add int %A, %B
10 ret int %C
2 define i32 @test() {
3 entry:
4 ret i32 7
5 Test: ; No predecessors!
6 %A = call i32 @test( ) ; [#uses=1]
7 %B = call i32 @test( ) ; [#uses=1]
8 %C = add i32 %A, %B ; [#uses=1]
9 ret i32 %C
1110 }
1211
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
0 ; RUN: llvm-as < %s | llc -march=x86 | \
11 ; RUN: not grep {.byte\[\[:space:\]\]*true}
22
3 %X = global bool true
4
3 @X = global i1 true ; [#uses=0]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {(%esp}
0 ; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp}
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
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep -i ESP | not grep sub
0 ; RUN: llvm-as < %s | llc -march=x86 | grep -i ESP | not grep sub
11
2 int %test(int %X) {
3 ret int %X
2 define i32 @test(i32 %X) {
3 ret i32 %X
44 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
1
2 bool %test1(double %X) {
3 %V = cast double %X to bool
4 ret bool %V
0 ; RUN: llvm-as < %s | llc -march=x86
1 define i1 @test1(double %X) {
2 %V = fcmp one double %X, 0.000000e+00 ; [#uses=1]
3 ret i1 %V
54 }
65
7 double %test2(ulong %X) {
8 %V = cast ulong %X to double
9 ret double %V
6 define double @test2(i64 %X) {
7 %V = uitofp i64 %X to double ; [#uses=1]
8 ret double %V
109 }
10
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep {j\[lgbe\]}
0 ; RUN: llvm-as < %s | llc -march=x86 | not grep {j\[lgbe\]}
11
2 int %max(int %A, int %B) {
3 %gt = setgt int %A, %B
4 %R = select bool %gt, int %A, int %B
5 ret int %R
2 define i32 @max(i32 %A, i32 %B) {
3 %gt = icmp sgt i32 %A, %B ; [#uses=1]
4 %R = select i1 %gt, i32 %A, i32 %B ; [#uses=1]
5 ret i32 %R
66 }
7
11 ; overlapping live intervals. When two overlapping intervals have the same
22 ; value, they can be joined though.
33 ;
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -regalloc=linearscan | \
4 ; RUN: llvm-as < %s | llc -march=x86 -regalloc=linearscan | \
55 ; RUN: not grep {mov %\[A-Z\]\\\{2,3\\\}, %\[A-Z\]\\\{2,3\\\}}
66
7 long %test(long %x) {
7 define i64 @test(i64 %x) {
88 entry:
9 %tmp.1 = mul long %x, 4294967297 ; [#uses=1]
10 ret long %tmp.1
9 %tmp.1 = mul i64 %x, 4294967297 ; [#uses=1]
10 ret i64 %tmp.1
1111 }
12
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 implementation ; Functions:
2 define double @test(double %d) {
3 %X = select i1 false, double %d, double %d ; [#uses=1]
4 ret double %X
5 }
36
4 double %test(double %d) {
5 %X = select bool false, double %d, double %d ; [#uses=0]
6 ret double %X
7 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 bool %T(double %X) {
3 %V = seteq double %X, %X
4 ret bool %V
2 define i1 @T(double %X) {
3 %V = fcmp oeq double %X, %X ; [#uses=1]
4 ret i1 %V
55 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 bool %test(bool %C, bool %D, int %X, int %Y) {
3 %E = setlt int %X, %Y
4 %F = select bool %C, bool %D, bool %E
5 ret bool %F
2 define i1 @test(i1 %C, i1 %D, i32 %X, i32 %Y) {
3 %E = icmp slt i32 %X, %Y ; [#uses=1]
4 %F = select i1 %C, i1 %D, i1 %E ; [#uses=1]
5 ret i1 %F
66 }
77
22 ; is invalid code (there is no correct way to order the instruction). Check
33 ; that we do not fold the load into the sub.
44
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep sub.*GLOBAL
5 ; RUN: llvm-as < %s | llc -march=x86 | not grep sub.*GLOBAL
66
7 %GLOBAL = external global int
7 @GLOBAL = external global i32 ; [#uses=1]
88
9 int %test(int* %P1, int* %P2, int* %P3) {
10 %L = load int* %GLOBAL
11 store int 12, int* %P2
12 %Y = load int* %P3
13 %Z = sub int %Y, %L
14 ret int %Z
9 define i32 @test(i32* %P1, i32* %P2, i32* %P3) {
10 %L = load i32* @GLOBAL ; [#uses=1]
11 store i32 12, i32* %P2
12 %Y = load i32* %P3 ; [#uses=1]
13 %Z = sub i32 %Y, %L ; [#uses=1]
14 ret i32 %Z
1515 }
16
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 18446744073709551612
0 ; RUN: llvm-as < %s | llc -march=x86 | not grep 18446744073709551612
11
2 %A = external global int
2 @A = external global i32 ; [#uses=1]
3 @Y = global i32* getelementptr (i32* @A, i32 -1) ; [#uses=0]
34
4 %Y = global int* getelementptr (int* %A, int -1)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=generic
0 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=generic
11 ; Make sure LLC doesn't crash in the stackifier due to FP PHI nodes.
22
3 void %radfg_() {
3 define void @radfg_() {
44 entry:
5 br bool false, label %no_exit.16.preheader, label %loopentry.0
5 br i1 false, label %no_exit.16.preheader, label %loopentry.0
6 loopentry.0: ; preds = %entry
7 ret void
8 no_exit.16.preheader: ; preds = %entry
9 br label %no_exit.16
10 no_exit.16: ; preds = %no_exit.16, %no_exit.16.preheader
11 br i1 false, label %loopexit.16.loopexit, label %no_exit.16
12 loopexit.16.loopexit: ; preds = %no_exit.16
13 br label %no_exit.18
14 no_exit.18: ; preds = %loopexit.20, %loopexit.16.loopexit
15 %tmp.882 = add float 0.000000e+00, 0.000000e+00 ; [#uses=2]
16 br i1 false, label %loopexit.19, label %no_exit.19.preheader
17 no_exit.19.preheader: ; preds = %no_exit.18
18 ret void
19 loopexit.19: ; preds = %no_exit.18
20 br i1 false, label %loopexit.20, label %no_exit.20
21 no_exit.20: ; preds = %loopexit.21, %loopexit.19
22 %ai2.1122.tmp.3 = phi float [ %tmp.958, %loopexit.21 ], [ %tmp.882, %loopexit.19 ] ; [#uses=1]
23 %tmp.950 = mul float %tmp.882, %ai2.1122.tmp.3 ; [#uses=1]
24 %tmp.951 = sub float 0.000000e+00, %tmp.950 ; [#uses=1]
25 %tmp.958 = add float 0.000000e+00, 0.000000e+00 ; [#uses=1]
26 br i1 false, label %loopexit.21, label %no_exit.21.preheader
27 no_exit.21.preheader: ; preds = %no_exit.20
28 ret void
29 loopexit.21: ; preds = %no_exit.20
30 br i1 false, label %loopexit.20, label %no_exit.20
31 loopexit.20: ; preds = %loopexit.21, %loopexit.19
32 %ar2.1124.tmp.2 = phi float [ 0.000000e+00, %loopexit.19 ], [ %tmp.951, %loopexit.21 ] ; [#uses=0]
33 br i1 false, label %loopexit.18.loopexit, label %no_exit.18
34 loopexit.18.loopexit: ; preds = %loopexit.20
35 ret void
36 }
637
7 loopentry.0: ; preds = %entry
8 ret void
9
10 no_exit.16.preheader: ; preds = %entry
11 br label %no_exit.16
12
13 no_exit.16: ; preds = %no_exit.16, %no_exit.16.preheader
14 br bool false, label %loopexit.16.loopexit, label %no_exit.16
15
16 loopexit.16.loopexit: ; preds = %no_exit.16
17 br label %no_exit.18
18
19 no_exit.18: ; preds = %loopexit.20, %loopexit.16.loopexit
20 %tmp.882 = add float 0.000000e+00, 0.000000e+00 ; [#uses=2]
21 br bool false, label %loopexit.19, label %no_exit.19.preheader
22
23 no_exit.19.preheader: ; preds = %no_exit.18
24 ret void
25
26 loopexit.19: ; preds = %no_exit.18
27 br bool false, label %loopexit.20, label %no_exit.20
28
29 no_exit.20: ; preds = %loopexit.21, %loopexit.19
30 %ai2.1122.tmp.3 = phi float [ %tmp.958, %loopexit.21 ], [ %tmp.882, %loopexit.19 ] ; [#uses=1]
31 %tmp.950 = mul float %tmp.882, %ai2.1122.tmp.3 ; [#uses=1]
32 %tmp.951 = sub float 0.000000e+00, %tmp.950 ; [#uses=1]
33 %tmp.958 = add float 0.000000e+00, 0.000000e+00 ; [#uses=1]
34 br bool false, label %loopexit.21, label %no_exit.21.preheader
35
36 no_exit.21.preheader: ; preds = %no_exit.20
37 ret void
38
39 loopexit.21: ; preds = %no_exit.20
40 br bool false, label %loopexit.20, label %no_exit.20
41
42 loopexit.20: ; preds = %loopexit.21, %loopexit.19
43 %ar2.1124.tmp.2 = phi float [ 0.000000e+00, %loopexit.19 ], [ %tmp.951, %loopexit.21 ] ; [#uses=0]
44 br bool false, label %loopexit.18.loopexit, label %no_exit.18
45
46 loopexit.18.loopexit: ; preds = %loopexit.20
47 ret void
48 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
0 ; RUN: llvm-as < %s | llc -march=x86 | \
11 ; RUN: grep shld | count 1
22 ;
33 ; Check that the isel does not fold the shld, which already folds a load
44 ; and has two uses, into a store.
5 %A = external global uint
65
7 uint %test5(uint %B, ubyte %C) {
8 %tmp.1 = load uint *%A;
9 %tmp.2 = shl uint %tmp.1, ubyte %C
10 %tmp.3 = sub ubyte 32, %C
11 %tmp.4 = shr uint %B, ubyte %tmp.3
12 %tmp.5 = or uint %tmp.4, %tmp.2
13 store uint %tmp.5, uint* %A
14 ret uint %tmp.5
6 @A = external global i32 ; [#uses=2]
7
8 define i32 @test5(i32 %B, i8 %C) {
9 %tmp.1 = load i32* @A ; [#uses=1]
10 %shift.upgrd.1 = zext i8 %C to i32 ; [#uses=1]
11 %tmp.2 = shl i32 %tmp.1, %shift.upgrd.1 ; [#uses=1]
12 %tmp.3 = sub i8 32, %C ; [#uses=1]
13 %shift.upgrd.2 = zext i8 %tmp.3 to i32 ; [#uses=1]
14 %tmp.4 = lshr i32 %B, %shift.upgrd.2 ; [#uses=1]
15 %tmp.5 = or i32 %tmp.4, %tmp.2 ; [#uses=2]
16 store i32 %tmp.5, i32* @A
17 ret i32 %tmp.5
1518 }
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep {subl.*%esp}
0 ; RUN: llvm-as < %s | llc -march=x86 | not grep {subl.*%esp}
11
2 int %f(int %a, int %b) {
3 %tmp.2 = mul int %a, %a
4 %tmp.5 = shl int %a, ubyte 1
5 %tmp.6 = mul int %tmp.5, %b
6 %tmp.10 = mul int %b, %b
7 %tmp.7 = add int %tmp.10, %tmp.2
8 %tmp.11 = add int %tmp.7, %tmp.6
9 ret int %tmp.11
2 define i32 @f(i32 %a, i32 %b) {
3 %tmp.2 = mul i32 %a, %a ; [#uses=1]
4 %tmp.5 = shl i32 %a, 1 ; [#uses=1]
5 %tmp.6 = mul i32 %tmp.5, %b ; [#uses=1]
6 %tmp.10 = mul i32 %b, %b ; [#uses=1]
7 %tmp.7 = add i32 %tmp.10, %tmp.2 ; [#uses=1]
8 %tmp.11 = add i32 %tmp.7, %tmp.6 ; [#uses=1]
9 ret i32 %tmp.11
1010 }
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& \
0 ; RUN: llvm-as < %s | llc -march=x86 -stats |& \
11 ; RUN: grep asm-printer | grep 7
22
3 int %g(int %a, int %b) {
4 %tmp.1 = shl int %b, ubyte 1
5 %tmp.3 = add int %tmp.1, %a
6 %tmp.5 = mul int %tmp.3, %a
7 %tmp.8 = mul int %b, %b
8 %tmp.9 = add int %tmp.5, %tmp.8
9 ret int %tmp.9
3 define i32 @g(i32 %a, i32 %b) {
4 %tmp.1 = shl i32 %b, 1 ; [#uses=1]
5 %tmp.3 = add i32 %tmp.1, %a ; [#uses=1]
6 %tmp.5 = mul i32 %tmp.3, %a ; [#uses=1]
7 %tmp.8 = mul i32 %b, %b ; [#uses=1]
8 %tmp.9 = add i32 %tmp.5, %tmp.8 ; [#uses=1]
9 ret i32 %tmp.9
1010 }
11
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah
0 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah
1 ; END.
12
2 target endian = little
3 target pointersize = 32
3 target datalayout = "e-p:32:32"
44 target triple = "i686-apple-darwin8.6.1"
55 %struct.GLTColor4 = type { float, float, float, float }
66 %struct.GLTCoord3 = type { float, float, float }
7 %struct.__GLIContextRec = type { { %struct.anon, { [24 x [16 x float]], [24 x [16 x float]] }, %struct.GLTColor4, { float, float, float, float, %struct.GLTCoord3, float } }, { float, float, float, float, float, float, float, float, [4 x uint], [4 x uint], [4 x uint] } }
8 %struct.__GLvertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, ubyte, ubyte, ubyte, ubyte, [4 x float], [2 x sbyte*], uint, uint, [16 x %struct.GLTColor4] }
7 %struct.__GLIContextRec = type { { %struct.anon, { [24 x [16 x float]], [24 x [16 x float]] }, %struct.GLTColor4, { float, float, float, float, %struct.GLTCoord3, float } }, { float, float, float, float, float, float, float, float, [4 x i32], [4 x i32], [4 x i32] } }
8 %struct.__GLvertex = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, %struct.GLTColor4, float, float, float, i8, i8, i8, i8, [4 x float], [2 x i8*], i32, i32, [16 x %struct.GLTColor4] }
99 %struct.anon = type { float, float, float, float, float, float, float, float }
1010
11 implementation ; Functions:
11 declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
1212
13 declare <4 x float> %llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, sbyte)
13 declare <4 x i32> @llvm.x86.sse2.packssdw.128(<4 x i32>, <4 x i32>)
1414
15 declare <4 x int> %llvm.x86.sse2.packssdw.128(<4 x int>, <4 x int>)
15 declare i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8>)
1616
17 declare int %llvm.x86.sse2.pmovmskb.128(<16 x sbyte>)
18
19 void %gleLLVMVecInterpolateClip() {
17 define void @gleLLVMVecInterpolateClip() {
2018 entry:
21 br bool false, label %cond_false, label %cond_false183
22
19 br i1 false, label %cond_false, label %cond_false183
2320 cond_false: ; preds = %entry
24 br bool false, label %cond_false183, label %cond_true69
25
21 br i1 false, label %cond_false183, label %cond_true69
2622 cond_true69: ; preds = %cond_false
2723 ret void
28
2924 cond_false183: ; preds = %cond_false, %entry
30 %vuizmsk.0.1 = phi <4 x int> [ < int -1, int -1, int -1, int 0 >, %entry ], [ < int -1, int 0, int 0, int 0 >, %cond_false ] ; <<4 x int>> [#uses=2]
31 %tmp192 = extractelement <4 x int> %vuizmsk.0.1, uint 2 ; [#uses=1]
32 %tmp193 = extractelement <4 x int> %vuizmsk.0.1, uint 3 ; [#uses=2]
33 %tmp195 = insertelement <4 x int> zeroinitializer, int %tmp192, uint 1 ; <<4 x int>> [#uses=1]
34 %tmp196 = insertelement <4 x int> %tmp195, int %tmp193, uint 2 ; <<4 x int>> [#uses=1]
35 %tmp197 = insertelement <4 x int> %tmp196, int %tmp193, uint 3 ; <<4 x int>> [#uses=1]
36 %tmp336 = and <4 x int> zeroinitializer, %tmp197 ; <<4 x int>> [#uses=1]
37 %tmp337 = cast <4 x int> %tmp336 to <4 x float> ; <<4 x float>> [#uses=1]
38 %tmp378 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp337, <4 x float> zeroinitializer, sbyte 1 ) ; <<4 x float>> [#uses=1]
39 %tmp379 = cast <4 x float> %tmp378 to <4 x int> ; <<4 x int>> [#uses=1]
40 %tmp388 = tail call <4 x int> %llvm.x86.sse2.packssdw.128( <4 x int> zeroinitializer, <4 x int> %tmp379 ) ; <<4 x int>> [#uses=1]
41 %tmp392 = cast <4 x int> %tmp388 to <8 x short> ; <<8 x short>> [#uses=1]
42 %tmp399 = extractelement <8 x short> %tmp392, uint 7 ; [#uses=1]
43 %tmp423 = insertelement <8 x short> zeroinitializer, short %tmp399, uint 7 ; <<8 x short>> [#uses=1]
44 %tmp427 = cast <8 x short> %tmp423 to <16 x sbyte> ; <<16 x sbyte>> [#uses=1]
45 %tmp428 = tail call int %llvm.x86.sse2.pmovmskb.128( <16 x sbyte> %tmp427 ) ; [#uses=1]
46 %tmp432 = cast int %tmp428 to sbyte ; [#uses=1]
47 %tmp = and sbyte %tmp432, 42 ; [#uses=1]
48 %tmp436 = cast sbyte %tmp to ubyte ; [#uses=1]
49 %tmp446 = cast ubyte %tmp436 to uint ; [#uses=1]
50 %tmp447 = shl uint %tmp446, ubyte 24 ; [#uses=1]
51 %tmp449 = or uint 0, %tmp447 ; [#uses=1]
52 store uint %tmp449, uint* null
25 %vuizmsk.0.1 = phi <4 x i32> [ < i32 -1, i32 -1, i32 -1, i32 0 >, %entry ], [ < i32 -1, i32 0, i32 0, i32 0 >, %cond_false ] ; <<4 x i32>> [#uses=2]
26 %tmp192 = extractelement <4 x i32> %vuizmsk.0.1, i32 2 ; [#uses=1]
27 %tmp193 = extractelement <4 x i32> %vuizmsk.0.1, i32 3 ; [#uses=2]
28 %tmp195 = insertelement <4 x i32> zeroinitializer, i32 %tmp192, i32 1 ; <<4 x i32>> [#uses=1]
29 %tmp196 = insertelement <4 x i32> %tmp195, i32 %tmp193, i32 2 ; <<4 x i32>> [#uses=1]
30 %tmp197 = insertelement <4 x i32> %tmp196, i32 %tmp193, i32 3 ; <<4 x i32>> [#uses=1]
31 %tmp336 = and <4 x i32> zeroinitializer, %tmp197 ; <<4 x i32>> [#uses=1]
32 %tmp337 = bitcast <4 x i32> %tmp336 to <4 x float> ; <<4 x float>> [#uses=1]
33 %tmp378 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp337, <4 x float> zeroinitializer, i8 1 ) ; <<4 x float>> [#uses=1]
34 %tmp379 = bitcast <4 x float> %tmp378 to <4 x i32> ; <<4 x i32>> [#uses=1]
35 %tmp388 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> zeroinitializer, <4 x i32> %tmp379 ) ; <<4 x i32>> [#uses=1]
36 %tmp392 = bitcast <4 x i32> %tmp388 to <8 x i16> ; <<8 x i16>> [#uses=1]
37 %tmp399 = extractelement <8 x i16> %tmp392, i32 7 ; [#uses=1]
38 %tmp423 = insertelement <8 x i16> zeroinitializer, i16 %tmp399, i32 7 ; <<8 x i16>> [#uses=1]
39 %tmp427 = bitcast <8 x i16> %tmp423 to <16 x i8> ; <<16 x i8>> [#uses=1]
40 %tmp428 = tail call i32 @llvm.x86.sse2.pmovmskb.128( <16 x i8> %tmp427 ) ; [#uses=1]
41 %tmp432 = trunc i32 %tmp428 to i8 ; [#uses=1]
42 %tmp = and i8 %tmp432, 42 ; [#uses=1]
43 %tmp436 = bitcast i8 %tmp to i8 ; [#uses=1]
44 %tmp446 = zext i8 %tmp436 to i32 ; [#uses=1]
45 %tmp447 = shl i32 %tmp446, 24 ; [#uses=1]
46 %tmp449 = or i32 0, %tmp447 ; [#uses=1]
47 store i32 %tmp449, i32* null
5348 ret void
5449 }
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
22 ; RUN: grep {movl _last} | count 1
3 ; RUN: llvm-upgrade < %s | llvm-as | \
3 ; RUN: llvm-as < %s | \
44 ; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
55 ; RUN: grep {cmpl.*_last} | count 1
66
7 %block = external global ubyte* ; [#uses=1]
8 %last = external global int ; [#uses=3]
7 @block = external global i8* ; [#uses=1]
8 @last = external global i32 ; [#uses=3]
99
10 implementation ; Functions:
10 define i1 @loadAndRLEsource_no_exit_2E_1_label_2E_0(i32 %tmp.21.reload, i32 %tmp.8) {
11 newFuncRoot:
12 br label %label.0
13 label.0.no_exit.1_crit_edge.exitStub: ; preds = %label.0
14 ret i1 true
15 codeRepl5.exitStub: ; preds = %label.0
16 ret i1 false
17 label.0: ; preds = %newFuncRoot
18 %tmp.35 = load i32* @last ; [#uses=1]
19 %inc.1 = add i32 %tmp.35, 1 ; [#uses=2]
20 store i32 %inc.1, i32* @last
21 %tmp.36 = load i8** @block ; [#uses=1]
22 %tmp.38 = getelementptr i8* %tmp.36, i32 %inc.1 ; [#uses=1]
23 %tmp.40 = trunc i32 %tmp.21.reload to i8 ; [#uses=1]
24 store i8 %tmp.40, i8* %tmp.38
25 %tmp.910 = load i32* @last ; [#uses=1]
26 %tmp.1111 = icmp slt i32 %tmp.910, %tmp.8 ; [#uses=1]
27 %tmp.1412 = icmp ne i32 %tmp.21.reload, 257 ; [#uses=1]
28 %tmp.1613 = and i1 %tmp.1111, %tmp.1412 ; [#uses=1]
29 br i1 %tmp.1613, label %label.0.no_exit.1_crit_edge.exitStub, label %codeRepl5.exitStub
30 }
1131
12 bool %loadAndRLEsource_no_exit_2E_1_label_2E_0(int %tmp.21.reload, int %tmp.8) {
13 newFuncRoot:
14 br label %label.0
15
16 label.0.no_exit.1_crit_edge.exitStub: ; preds = %label.0
17 ret bool true
18
19 codeRepl5.exitStub: ; preds = %label.0
20 ret bool false
21
22 label.0: ; preds = %newFuncRoot
23 %tmp.35 = load int* %last ; [#uses=1]
24 %inc.1 = add int %tmp.35, 1 ; [#uses=2]
25 store int %inc.1, int* %last
26 %tmp.36 = load ubyte** %block ; [#uses=1]
27 %tmp.38 = getelementptr ubyte* %tmp.36, int %inc.1 ; [#uses=1]
28 %tmp.40 = cast int %tmp.21.reload to ubyte ; [#uses=1]
29 store ubyte %tmp.40, ubyte* %tmp.38
30 %tmp.910 = load int* %last ; [#uses=1]
31 %tmp.1111 = setlt int %tmp.910, %tmp.8 ; [#uses=1]
32 %tmp.1412 = setne int %tmp.21.reload, 257 ; [#uses=1]
33 %tmp.1613 = and bool %tmp.1111, %tmp.1412 ; [#uses=1]
34 br bool %tmp.1613, label %label.0.no_exit.1_crit_edge.exitStub, label %codeRepl5.exitStub
35 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah -stats |& \
0 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stats |& \
11 ; RUN: not grep {Number of register spills}
2 ; END.
23
3 int %foo(<4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
4
5 define i32 @foo(<4 x float>* %a, <4 x float>* %b, <4 x float>* %c, <4 x float>* %d) {
46 %tmp44 = load <4 x float>* %a ; <<4 x float>> [#uses=9]
57 %tmp46 = load <4 x float>* %b ; <<4 x float>> [#uses=1]
68 %tmp48 = load <4 x float>* %c ; <<4 x float>> [#uses=1]
79 %tmp50 = load <4 x float>* %d ; <<4 x float>> [#uses=1]
8 %tmp51 = cast <4 x float> %tmp44 to <4 x int> ; <<4 x int>> [#uses=1]
9 %tmp = shufflevector <4 x int> %tmp51, <4 x int> undef, <4 x uint> < uint 3, uint 3, uint 3, uint 3 > ; <<4 x int>> [#uses=2]
10 %tmp52 = cast <4 x int> %tmp to <4 x float> ; <<4 x float>> [#uses=1]
11 %tmp60 = xor <4 x int> %tmp, < int -2147483648, int -2147483648, int -2147483648, int -2147483648 > ; <<4 x int>> [#uses=1]
12 %tmp61 = cast <4 x int> %tmp60 to <4 x float> ; <<4 x float>> [#uses=1]
13 %tmp74 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp52, <4 x float> %tmp44, sbyte 1 ) ; <<4 x float>> [#uses=1]
14 %tmp75 = cast <4 x float> %tmp74 to <4 x int> ; <<4 x int>> [#uses=1]
15 %tmp88 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp61, sbyte 1 ) ; <<4 x float>> [#uses=1]
16 %tmp89 = cast <4 x float> %tmp88 to <4 x int> ; <<4 x int>> [#uses=1]
17 %tmp98 = tail call <4 x int> %llvm.x86.sse2.packssdw.128( <4 x int> %tmp75, <4 x int> %tmp89 ) ; <<4 x int>> [#uses=1]
18 %tmp102 = cast <4 x int> %tmp98 to <8 x short> ; <<8 x short>> [#uses=1]
19 %tmp = shufflevector <8 x short> %tmp102, <8 x short> undef, <8 x uint> < uint 0, uint 1, uint 2, uint 3, uint 6, uint 5, uint 4, uint 7 > ; <<8 x short>> [#uses=1]
20 %tmp105 = shufflevector <8 x short> %tmp, <8 x short> undef, <8 x uint> < uint 2, uint 1, uint 0, uint 3, uint 4, uint 5, uint 6, uint 7 > ; <<8 x short>> [#uses=1]
21 %tmp105 = cast <8 x short> %tmp105 to <4 x float> ; <<4 x float>> [#uses=1]
22 store <4 x float> %tmp105, <4 x float>* %a
23 %tmp108 = cast <4 x float> %tmp46 to <4 x int> ; <<4 x int>> [#uses=1]
24 %tmp109 = shufflevector <4 x int> %tmp108, <4 x int> undef, <4 x uint> < uint 3, uint 3, uint 3, uint 3 > ; <<4 x int>> [#uses=2]
25 %tmp109 = cast <4 x int> %tmp109 to <4 x float> ; <<4 x float>> [#uses=1]
26 %tmp119 = xor <4 x int> %tmp109, < int -2147483648, int -2147483648, int -2147483648, int -2147483648 > ; <<4 x int>> [#uses=1]
27 %tmp120 = cast <4 x int> %tmp119 to <4 x float> ; <<4 x float>> [#uses=1]
28 %tmp133 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp109, <4 x float> %tmp44, sbyte 1 ) ; <<4 x float>> [#uses=1]
29 %tmp134 = cast <4 x float> %tmp133 to <4 x int> ; <<4 x int>> [#uses=1]
30 %tmp147 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp120, sbyte 1 ) ; <<4 x float>> [#uses=1]
31 %tmp148 = cast <4 x float> %tmp147 to <4 x int> ; <<4 x int>> [#uses=1]
32 %tmp159 = tail call <4 x int> %llvm.x86.sse2.packssdw.128( <4 x int> %tmp134, <4 x int> %tmp148 ) ; <<4 x int>> [#uses=1]
33 %tmp163 = cast <4 x int> %tmp159 to <8 x short> ; <<8 x short>> [#uses=1]
34 %tmp164 = shufflevector <8 x short> %tmp163, <8 x short> undef, <8 x uint> < uint 0, uint 1, uint 2, uint 3, uint 6, uint 5, uint 4, uint 7 > ; <<8 x short>> [#uses=1]
35 %tmp166 = shufflevector <8 x short> %tmp164, <8 x short> undef, <8 x uint> < uint 2, uint 1, uint 0, uint 3, uint 4, uint 5, uint 6, uint 7 > ; <<8 x short>> [#uses=1]
36 %tmp166 = cast <8 x short> %tmp166 to <4 x float> ; <<4 x float>> [#uses=1]
37 store <4 x float> %tmp166, <4 x float>* %b
38 %tmp169 = cast <4 x float> %tmp48 to <4 x int> ; <<4 x int>> [#uses=1]
39 %tmp170 = shufflevector <4 x int> %tmp169, <4 x int> undef, <4 x uint> < uint 3, uint 3, uint 3, uint 3 > ; <<4 x int>> [#uses=2]
40 %tmp170 = cast <4 x int> %tmp170 to <4 x float> ; <<4 x float>> [#uses=1]
41 %tmp180 = xor <4 x int> %tmp170, < int -2147483648, int -2147483648, int -2147483648, int -2147483648 > ; <<4 x int>> [#uses=1]
42 %tmp181 = cast <4 x int> %tmp180 to <4 x float> ; <<4 x float>> [#uses=1]
43 %tmp194 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp170, <4 x float> %tmp44, sbyte 1 ) ; <<4 x float>> [#uses=1]
44 %tmp195 = cast <4 x float> %tmp194 to <4 x int> ; <<4 x int>> [#uses=1]
45 %tmp208 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp181, sbyte 1 ) ; <<4 x float>> [#uses=1]
46 %tmp209 = cast <4 x float> %tmp208 to <4 x int> ; <<4 x int>> [#uses=1]
47 %tmp220 = tail call <4 x int> %llvm.x86.sse2.packssdw.128( <4 x int> %tmp195, <4 x int> %tmp209 ) ; <<4 x int>> [#uses=1]
48 %tmp224 = cast <4 x int> %tmp220 to <8 x short> ; <<8 x short>> [#uses=1]
49 %tmp225 = shufflevector <8 x short> %tmp224, <8 x short> undef, <8 x uint> < uint 0, uint 1, uint 2, uint 3, uint 6, uint 5, uint 4, uint 7 > ; <<8 x short>> [#uses=1]
50 %tmp227 = shufflevector <8 x short> %tmp225, <8 x short> undef, <8 x uint> < uint 2, uint 1, uint 0, uint 3, uint 4, uint 5, uint 6, uint 7 > ; <<8 x short>> [#uses=1]
51 %tmp227 = cast <8 x short> %tmp227 to <4 x float> ; <<4 x float>> [#uses=1]
52 store <4 x float> %tmp227, <4 x float>* %c
53 %tmp230 = cast <4 x float> %tmp50 to <4 x int> ; <<4 x int>> [#uses=1]
54 %tmp231 = shufflevector <4 x int> %tmp230, <4 x int> undef, <4 x uint> < uint 3, uint 3, uint 3, uint 3 > ; <<4 x int>> [#uses=2]
55 %tmp231 = cast <4 x int> %tmp231 to <4 x float> ; <<4 x float>> [#uses=1]
56 %tmp241 = xor <4 x int> %tmp231, < int -2147483648, int -2147483648, int -2147483648, int -2147483648 > ; <<4 x int>> [#uses=1]
57 %tmp242 = cast <4 x int> %tmp241 to <4 x float> ; <<4 x float>> [#uses=1]
58 %tmp255 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp231, <4 x float> %tmp44, sbyte 1 ) ; <<4 x float>> [#uses=1]
59 %tmp256 = cast <4 x float> %tmp255 to <4 x int> ; <<4 x int>> [#uses=1]
60 %tmp269 = tail call <4 x float> %llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp242, sbyte 1 ) ; <<4 x float>> [#uses=1]
61 %tmp270 = cast <4 x float> %tmp269 to <4 x int> ; <<4 x int>> [#uses=1]
62 %tmp281 = tail call <4 x int> %llvm.x86.sse2.packssdw.128( <4 x int> %tmp256, <4 x int> %tmp270 ) ; <<4 x int>> [#uses=1]
63 %tmp285 = cast <4 x int> %tmp281 to <8 x short> ; <<8 x short>> [#uses=1]
64 %tmp286 = shufflevector <8 x short> %tmp285, <8 x short> undef, <8 x uint> < uint 0, uint 1, uint 2, uint 3, uint 6, uint 5, uint 4, uint 7 > ; <<8 x short>> [#uses=1]
65 %tmp288 = shufflevector <8 x short> %tmp286, <8 x short> undef, <8 x uint> < uint 2, uint 1, uint 0, uint 3, uint 4, uint 5, uint 6, uint 7 > ; <<8 x short>> [#uses=1]
66 %tmp288 = cast <8 x short> %tmp288 to <4 x float> ; <<4 x float>> [#uses=1]
67 store <4 x float> %tmp288, <4 x float>* %d
68 ret int 0
10 %tmp51 = bitcast <4 x float> %tmp44 to <4 x i32> ; <<4 x i32>> [#uses=1]
11 %tmp = shufflevector <4 x i32> %tmp51, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
12 %tmp52 = bitcast <4 x i32> %tmp to <4 x float> ; <<4 x float>> [#uses=1]
13 %tmp60 = xor <4 x i32> %tmp, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
14 %tmp61 = bitcast <4 x i32> %tmp60 to <4 x float> ; <<4 x float>> [#uses=1]
15 %tmp74 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp52, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
16 %tmp75 = bitcast <4 x float> %tmp74 to <4 x i32> ; <<4 x i32>> [#uses=1]
17 %tmp88 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp61, i8 1 ) ; <<4 x float>> [#uses=1]
18 %tmp89 = bitcast <4 x float> %tmp88 to <4 x i32> ; <<4 x i32>> [#uses=1]
19 %tmp98 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp75, <4 x i32> %tmp89 ) ; <<4 x i32>> [#uses=1]
20 %tmp102 = bitcast <4 x i32> %tmp98 to <8 x i16> ; <<8 x i16>> [#uses=1]
21 %tmp.upgrd.1 = shufflevector <8 x i16> %tmp102, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
22 %tmp105 = shufflevector <8 x i16> %tmp.upgrd.1, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
23 %tmp105.upgrd.2 = bitcast <8 x i16> %tmp105 to <4 x float> ; <<4 x float>> [#uses=1]
24 store <4 x float> %tmp105.upgrd.2, <4 x float>* %a
25 %tmp108 = bitcast <4 x float> %tmp46 to <4 x i32> ; <<4 x i32>> [#uses=1]
26 %tmp109 = shufflevector <4 x i32> %tmp108, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
27 %tmp109.upgrd.3 = bitcast <4 x i32> %tmp109 to <4 x float> ; <<4 x float>> [#uses=1]
28 %tmp119 = xor <4 x i32> %tmp109, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
29 %tmp120 = bitcast <4 x i32> %tmp119 to <4 x float> ; <<4 x float>> [#uses=1]
30 %tmp133 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp109.upgrd.3, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
31 %tmp134 = bitcast <4 x float> %tmp133 to <4 x i32> ; <<4 x i32>> [#uses=1]
32 %tmp147 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp120, i8 1 ) ; <<4 x float>> [#uses=1]
33 %tmp148 = bitcast <4 x float> %tmp147 to <4 x i32> ; <<4 x i32>> [#uses=1]
34 %tmp159 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp134, <4 x i32> %tmp148 ) ; <<4 x i32>> [#uses=1]
35 %tmp163 = bitcast <4 x i32> %tmp159 to <8 x i16> ; <<8 x i16>> [#uses=1]
36 %tmp164 = shufflevector <8 x i16> %tmp163, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
37 %tmp166 = shufflevector <8 x i16> %tmp164, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
38 %tmp166.upgrd.4 = bitcast <8 x i16> %tmp166 to <4 x float> ; <<4 x float>> [#uses=1]
39 store <4 x float> %tmp166.upgrd.4, <4 x float>* %b
40 %tmp169 = bitcast <4 x float> %tmp48 to <4 x i32> ; <<4 x i32>> [#uses=1]
41 %tmp170 = shufflevector <4 x i32> %tmp169, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
42 %tmp170.upgrd.5 = bitcast <4 x i32> %tmp170 to <4 x float> ; <<4 x float>> [#uses=1]
43 %tmp180 = xor <4 x i32> %tmp170, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
44 %tmp181 = bitcast <4 x i32> %tmp180 to <4 x float> ; <<4 x float>> [#uses=1]
45 %tmp194 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp170.upgrd.5, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
46 %tmp195 = bitcast <4 x float> %tmp194 to <4 x i32> ; <<4 x i32>> [#uses=1]
47 %tmp208 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp181, i8 1 ) ; <<4 x float>> [#uses=1]
48 %tmp209 = bitcast <4 x float> %tmp208 to <4 x i32> ; <<4 x i32>> [#uses=1]
49 %tmp220 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp195, <4 x i32> %tmp209 ) ; <<4 x i32>> [#uses=1]
50 %tmp224 = bitcast <4 x i32> %tmp220 to <8 x i16> ; <<8 x i16>> [#uses=1]
51 %tmp225 = shufflevector <8 x i16> %tmp224, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
52 %tmp227 = shufflevector <8 x i16> %tmp225, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
53 %tmp227.upgrd.6 = bitcast <8 x i16> %tmp227 to <4 x float> ; <<4 x float>> [#uses=1]
54 store <4 x float> %tmp227.upgrd.6, <4 x float>* %c
55 %tmp230 = bitcast <4 x float> %tmp50 to <4 x i32> ; <<4 x i32>> [#uses=1]
56 %tmp231 = shufflevector <4 x i32> %tmp230, <4 x i32> undef, <4 x i32> < i32 3, i32 3, i32 3, i32 3 > ; <<4 x i32>> [#uses=2]
57 %tmp231.upgrd.7 = bitcast <4 x i32> %tmp231 to <4 x float> ; <<4 x float>> [#uses=1]
58 %tmp241 = xor <4 x i32> %tmp231, < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 > ; <<4 x i32>> [#uses=1]
59 %tmp242 = bitcast <4 x i32> %tmp241 to <4 x float> ; <<4 x float>> [#uses=1]
60 %tmp255 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp231.upgrd.7, <4 x float> %tmp44, i8 1 ) ; <<4 x float>> [#uses=1]
61 %tmp256 = bitcast <4 x float> %tmp255 to <4 x i32> ; <<4 x i32>> [#uses=1]
62 %tmp269 = tail call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %tmp44, <4 x float> %tmp242, i8 1 ) ; <<4 x float>> [#uses=1]
63 %tmp270 = bitcast <4 x float> %tmp269 to <4 x i32> ; <<4 x i32>> [#uses=1]
64 %tmp281 = tail call <4 x i32> @llvm.x86.sse2.packssdw.128( <4 x i32> %tmp256, <4 x i32> %tmp270 ) ; <<4 x i32>> [#uses=1]
65 %tmp285 = bitcast <4 x i32> %tmp281 to <8 x i16> ; <<8 x i16>> [#uses=1]
66 %tmp286 = shufflevector <8 x i16> %tmp285, <8 x i16> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 6, i32 5, i32 4, i32 7 > ; <<8 x i16>> [#uses=1]
67 %tmp288 = shufflevector <8 x i16> %tmp286, <8 x i16> undef, <8 x i32> < i32 2, i32 1, i32 0, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x i16>> [#uses=1]
68 %tmp288.upgrd.8 = bitcast <8 x i16> %tmp288 to <4 x float> ; <<4 x float>> [#uses=1]
69 store <4 x float> %tmp288.upgrd.8, <4 x float>* %d
70 ret i32 0
6971 }
7072
71 declare <4 x float> %llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, sbyte)
73 declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
7274
73 declare <4 x int> %llvm.x86.sse2.packssdw.128(<4 x int>, <4 x int>)
75 declare <4 x i32> @llvm.x86.sse2.packssdw.128(<4 x i32>, <4 x i32>)
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=x86 -relocation-model=static -stats |& \
22 ; RUN: grep asm-printer | grep 14
33 ;
4 %size20 = external global uint ; [#uses=1]
5 %in5 = external global ubyte* ; *> [#uses=1]
4 @size20 = external global i32 ; *> [#uses=1]
5 @in5 = external global i8* ; [#uses=1]
66
7 int %compare(sbyte* %a, sbyte* %b) {
8 %tmp = cast sbyte* %a to uint* ; [#uses=1]
9 %tmp1 = cast sbyte* %b to uint* ; [#uses=1]
10 %tmp = load uint* %size20 ; [#uses=1]
11 %tmp = load ubyte** %in5 ; [#uses=2]
12 %tmp3 = load uint* %tmp1 ; [#uses=1]
13 %tmp4 = getelementptr ubyte* %tmp, uint %tmp3 ; [#uses=1]
14 %tmp7 = load uint* %tmp ; [#uses=1]
15 %tmp8 = getelementptr ubyte* %tmp, uint %tmp7 ; [#uses=1]
16 %tmp8 = cast ubyte* %tmp8 to sbyte* ; [#uses=1]
17 %tmp4 = cast ubyte* %tmp4 to sbyte* ; [#uses=1]
18 %tmp = tail call int %memcmp( sbyte* %tmp8, sbyte* %tmp4, uint %tmp ) ; [#uses=1]
19 ret int %tmp
7 define i32 @compare(i8* %a, i8* %b) {
8 %tmp = bitcast i8* %a to i32* ; [#uses=1]
9 %tmp1 = bitcast i8* %b to i32* ; [#uses=1]
10 %tmp.upgrd.1 = load i32* @size20 ; [#uses=1]
11 %tmp.upgrd.2 = load i8** @in5 ; [#uses=2]
12 %tmp3 = load i32* %tmp1 ; [#uses=1]
13 %gep.upgrd.3 = zext i32 %tmp3 to i64 ; [#uses=1]
14 %tmp4 = getelementptr i8* %tmp.upgrd.2, i64 %gep.upgrd.3 ; [#uses=2]
15 %tmp7 = load i32* %tmp ; [#uses=1]
16 %gep.upgrd.4 = zext i32 %tmp7 to i64 ; [#uses=1]
17 %tmp8 = getelementptr i8* %tmp.upgrd.2, i64 %gep.upgrd.4 ; [#uses=2]
18 %tmp.upgrd.5 = tail call i32 @memcmp( i8* %tmp8, i8* %tmp4, i32 %tmp.upgrd.1 ) ; [#uses=1]
19 ret i32 %tmp.upgrd.5
2020 }
2121
22 declare int %memcmp(sbyte*, sbyte*, uint)
22 declare i32 @memcmp(i8*, i8*, i32)
23
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -stats |& \
0 ; RUN: llvm-as < %s | llc -march=x86 -stats |& \
11 ; RUN: grep asm-printer | grep 13
22
3 void %_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(sbyte* %tmp435.i, uint* %tmp449.i.out) {
3 define void @_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(i8* %tmp435.i, i32* %tmp449.i.out) {
44 newFuncRoot:
55 br label %cond_true456.i
6 bb459.i.exitStub: ; preds = %cond_true456.i
7 store i32 %tmp449.i, i32* %tmp449.i.out
8 ret void
9 cond_true456.i: ; preds = %cond_true456.i, %newFuncRoot
10 %__s441.2.4.i = phi i8* [ %tmp451.i.upgrd.1, %cond_true456.i ], [ %tmp435.i, %newFuncRoot ] ; [#uses=2]
11 %__h.2.4.i = phi i32 [ %tmp449.i, %cond_true456.i ], [ 0, %newFuncRoot ] ; [#uses=1]
12 %tmp446.i = mul i32 %__h.2.4.i, 5 ; [#uses=1]
13 %tmp.i = load i8* %__s441.2.4.i ; [#uses=1]
14 %tmp448.i = sext i8 %tmp.i to i32 ; [#uses=1]
15 %tmp449.i = add i32 %tmp448.i, %tmp446.i ; [#uses=2]
16 %tmp450.i = ptrtoint i8* %__s441.2.4.i to i32 ; [#uses=1]
17 %tmp451.i = add i32 %tmp450.i, 1 ; [#uses=1]
18 %tmp451.i.upgrd.1 = inttoptr i32 %tmp451.i to i8* ; [#uses=2]
19 %tmp45435.i = load i8* %tmp451.i.upgrd.1 ; [#uses=1]
20 %tmp45536.i = icmp eq i8 %tmp45435.i, 0 ; [#uses=1]
21 br i1 %tmp45536.i, label %bb459.i.exitStub, label %cond_true456.i
22 }
623
7 bb459.i.exitStub: ; preds = %cond_true456.i
8 store uint %tmp449.i, uint* %tmp449.i.out
9 ret void
10
11 cond_true456.i: ; preds = %cond_true456.i, %newFuncRoot
12 %__s441.2.4.i = phi sbyte* [ %tmp451.i, %cond_true456.i ], [ %tmp435.i, %newFuncRoot ] ; [#uses=2]
13 %__h.2.4.i = phi uint [ %tmp449.i, %cond_true456.i ], [ 0, %newFuncRoot ] ; [#uses=1]
14 %tmp446.i = mul uint %__h.2.4.i, 5 ; [#uses=1]
15 %tmp.i = load sbyte* %__s441.2.4.i ; [#uses=1]
16 %tmp448.i = cast sbyte %tmp.i to uint ; [#uses=1]
17 %tmp449.i = add uint %tmp448.i, %tmp446.i ; [#uses=2]
18 %tmp450.i = cast sbyte* %__s441.2.4.i to uint ; [#uses=1]
19 %tmp451.i = add uint %tmp450.i, 1 ; [#uses=1]
20 %tmp451.i = cast uint %tmp451.i to sbyte* ; [#uses=2]
21 %tmp45435.i = load sbyte* %tmp451.i ; [#uses=1]
22 %tmp45536.i = seteq sbyte %tmp45435.i, 0 ; [#uses=1]
23 br bool %tmp45536.i, label %bb459.i.exitStub, label %cond_true456.i
24 }
0 ; Coalescing from R32 to a subset R32_. Once another register coalescer bug is
11 ; fixed, the movb should go away as well.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -relocation-model=static | \
3 ; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | \
44 ; RUN: grep movl
55
6 %B = external global uint
7 %C = external global ushort*
6 @B = external global i32 ; [#uses=2]
7 @C = external global i16* ; [#uses=2]
88
9 void %test(uint %A) {
10 %A = cast uint %A to ubyte
11 %tmp2 = load uint* %B
12 %tmp3 = and ubyte %A, 16
13 %tmp4 = shl uint %tmp2, ubyte %tmp3
14 store uint %tmp4, uint* %B
15 %tmp6 = shr uint %A, ubyte 3
16 %tmp = load ushort** %C
17 %tmp8 = cast ushort* %tmp to uint
18 %tmp9 = add uint %tmp8, %tmp6
19 %tmp9 = cast uint %tmp9 to ushort*
20 store ushort* %tmp9, ushort** %C
9 define void @test(i32 %A) {
10 %A.upgrd.1 = trunc i32 %A to i8 ; [#uses=1]
11 %tmp2 = load i32* @B ; [#uses=1]
12 %tmp3 = and i8 %A.upgrd.1, 16 ; [#uses=1]
13 %shift.upgrd.2 = zext i8 %tmp3 to i32 ; [#uses=1]
14 %tmp4 = shl i32 %tmp2, %shift.upgrd.2 ; [#uses=1]
15 store i32 %tmp4, i32* @B
16 %tmp6 = lshr i32 %A, 3 ; [#uses=1]
17 %tmp = load i16** @C ; [#uses=1]
18 %tmp8 = ptrtoint i16* %tmp to i32 ; [#uses=1]
19 %tmp9 = add i32 %tmp8, %tmp6 ; [#uses=1]
20 %tmp9.upgrd.3 = inttoptr i32 %tmp9 to i16* ; [#uses=1]
21 store i16* %tmp9.upgrd.3, i16** @C
2122 ret void
2223 }
24
None ; RUN: llvm-upgrade < %s | llvm-as | \
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -march=x86 -relocation-model=static | not grep {subl.*%esp}
22
3 %A = external global ushort*
4 %B = external global uint
5 %C = external global uint
3 @A = external global i16* ; [#uses=1]
4 @B = external global i32 ; [#uses=1]
5 @C = external global i32 ; [#uses=2]
66
7 void %test() {
8 %tmp = load ushort** %A
9 %tmp1 = getelementptr ushort* %tmp, int 1
10 %tmp = load ushort* %tmp1
11 %tmp3 = cast ushort %tmp to uint
12 %tmp = load uint* %B
13 %tmp4 = and uint %tmp, 16
14 %tmp5 = load uint* %C
15 %tmp6 = cast uint %tmp4 to ubyte
16 %tmp7 = shl uint %tmp5, ubyte %tmp6
17 %tmp9 = xor ubyte %tmp6, 16
18 %tmp11 = shr uint %tmp3, ubyte %tmp9
19 %tmp12 = or uint %tmp11, %tmp7
20 store uint %tmp12, uint* %C
7 define void @test() {
8 %tmp = load i16** @A ; [#uses=1]
9 %tmp1 = getelementptr i16* %tmp, i32 1 ; [#uses=1]
10 %tmp.upgrd.1 = load i16* %tmp1 ; [#uses=1]
11 %tmp3 = zext i16 %tmp.upgrd.1 to i32 ; [#uses=1]
12 %tmp.upgrd.2 = load i32* @B ; [#uses=1]
13 %tmp4 = and i32 %tmp.upgrd.2, 16 ; [#uses=1]
14 %tmp5 = load i32* @C ; [#uses=1]
15 %tmp6 = trunc i32 %tmp4 to i8 ; [#uses=2]
16 %shift.upgrd.3 = zext i8 %tmp6 to i32 ; [#uses=1]
17 %tmp7 = shl i32 %tmp5, %shift.upgrd.3 ; [#uses=1]
18 %tmp9 = xor i8 %tmp6, 16 ; [#uses=1]
19 %shift.upgrd.4 = zext i8 %tmp9 to i32 ; [#uses=1]
20 %tmp11 = lshr i32 %tmp3, %shift.upgrd.4 ; [#uses=1]
21 %tmp12 = or i32 %tmp11, %tmp7 ; [#uses=1]
22 store i32 %tmp12, i32* @C
2123 ret void
2224 }
25
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
11
2 <4 x float> %opRSQ(<4 x float> %a) {
2 define <4 x float> @opRSQ(<4 x float> %a) {
33 entry:
4 %tmp2 = extractelement <4 x float> %a, uint 3
5 %abscond = setge float %tmp2, -0.000000e+00
6 %abs = select bool %abscond, float %tmp2, float 0.000000e+00
7 %tmp3 = tail call float %llvm.sqrt.f32( float %abs )
8 %tmp4 = div float 1.000000e+00, %tmp3
9 %tmp11 = insertelement <4 x float> zeroinitializer, float %tmp4, uint 3
4 %tmp2 = extractelement <4 x float> %a, i32 3 ; [#uses=2]
5 %abscond = fcmp oge float %tmp2, -0.000000e+00 ; [#uses=1]
6 %abs = select i1 %abscond, float %tmp2, float 0.000000e+00 ; [#uses=1]
7 %tmp3 = tail call float @llvm.sqrt.f32( float %abs ) ; [#uses=1]
8 %tmp4 = fdiv float 1.000000e+00, %tmp3 ; [#uses=1]
9 %tmp11 = insertelement <4 x float> zeroinitializer, float %tmp4, i32 3 ; <<4 x float>> [#uses=1]
1010 ret <4 x float> %tmp11
1111 }
1212
13 declare float %llvm.sqrt.f32(float)
13 declare float @llvm.sqrt.f32(float)
14
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep setnp
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -enable-unsafe-fp-math | \
0 ; RUN: llvm-as < %s | llc -march=x86 | grep setnp
1 ; RUN: llvm-as < %s | llc -march=x86 -enable-unsafe-fp-math | \
22 ; RUN: not grep setnp
33
4 uint %test(float %f) {
5 %tmp = seteq float %f, 0.000000e+00
6 %tmp = cast bool %tmp to uint
7 ret uint %tmp
4 define i32 @test(float %f) {
5 %tmp = fcmp oeq float %f, 0.000000e+00 ; [#uses=1]
6 %tmp.upgrd.1 = zext i1 %tmp to i32 ; [#uses=1]
7 ret i32 %tmp.upgrd.1
88 }
9
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 int %test() {
3 br bool false, label %cond_next33, label %cond_true12
4
5 cond_true12:
6 ret int 0
7
8 cond_next33:
9 %tmp44.i = call double %foo( double 0.000000e+00, int 32 )
10 %tmp61.i = load ubyte* null
11 %tmp61.i = cast ubyte %tmp61.i to int
12 %tmp58.i = or int 0, %tmp61.i
13 %tmp62.i = or int %tmp58.i, 0
14 %tmp62.i = cast int %tmp62.i to double
15 %tmp64.i = add double %tmp62.i, %tmp44.i
16 %tmp68.i = call double %foo( double %tmp64.i, int 0 )
17 ret int 0
2 define i32 @test() {
3 br i1 false, label %cond_next33, label %cond_true12
4 cond_true12: ; preds = %0
5 ret i32 0
6 cond_next33: ; preds = %0
7 %tmp44.i = call double @foo( double 0.000000e+00, i32 32 ) ; [#uses=1]
8 %tmp61.i = load i8* null ; [#uses=1]
9 %tmp61.i.upgrd.1 = zext i8 %tmp61.i to i32 ; [#uses=1]
10 %tmp58.i = or i32 0, %tmp61.i.upgrd.1 ; [#uses=1]
11 %tmp62.i = or i32 %tmp58.i, 0 ; [#uses=1]
12 %tmp62.i.upgrd.2 = sitofp i32 %tmp62.i to double ; [#uses=1]
13 %tmp64.i = add double %tmp62.i.upgrd.2, %tmp44.i ; [#uses=1]
14 %tmp68.i = call double @foo( double %tmp64.i, i32 0 ) ; [#uses=0]
15 ret i32 0
1816 }
1917
20 declare double %foo(double, int)
18 declare double @foo(double, i32)
19
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11 ; PR825
22
3 long %test() {
4 %tmp.i5 = call long asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"( ) ; [#uses=0]
5 ret long %tmp.i5
3 define i64 @test() {
4 %tmp.i5 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"( ) ; [#uses=1]
5 ret i64 %tmp.i5
66 }
7
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11 ; PR828
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:
8
9 void %_ZN5() {
10
11 cond_true9: ; preds = %entry
12 %tmp3.i.i = call int asm sideeffect "lock; cmpxchg $1,$2",
13 "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( int 0, int* null, int 0 )
14 ; [#uses=0]
15 ret void
6 define void @_ZN5() {
7 cond_true9:
8 %tmp3.i.i = call i32 asm sideeffect "lock; cmpxchg $1,$2", "={ax},q,m,0,~{dirflag},~{fpsr},~{flags},~{memory}"( i32 0, i32* null, i32 0 ) ; [#uses=0]
9 ret void
1610 }
1711
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att
0 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att
11 ; PR834
2 ; END.
23
3 target endian = little
4 target pointersize = 32
4 target datalayout = "e-p:32:32"
55 target triple = "i386-unknown-freebsd6.1"
6
7 %llvm.dbg.anchor.type = type { uint, uint }
8 %llvm.dbg.basictype.type = type { uint, { }*, sbyte*, { }*, uint, ulong, ulong, ulong, uint, uint }
9 %llvm.dbg.compile_unit.type = type { uint, { }*, uint, sbyte*, sbyte*, sbyte* }
10 %llvm.dbg.global_variable.type = type { uint, { }*, { }*, sbyte*, sbyte*, { }*, uint, { }*, bool, bool, { }* }
11 %x = global int 0 ; [#uses=1]
12 %llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
13 uint 327732,
14 { }* cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to { }*),
15 { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*),
16 sbyte* getelementptr ([2 x sbyte]* %str, int 0, int 0),
17 sbyte* null,
18 { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*),
19 uint 1,
20 { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*),
21 bool false,
22 bool true,
23 { }* cast (int* %x to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
24 %llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { uint 327680, uint 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
25 %llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
26 uint 327697,
27 { }* cast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to { }*),
28 uint 4,
29 sbyte* getelementptr ([10 x sbyte]* %str, int 0, int 0),
30 sbyte* getelementptr ([32 x sbyte]* %str, int 0, int 0),
31 sbyte* getelementptr ([45 x sbyte]* %str, int 0, int 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
32 %llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { uint 327680, uint 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
33 %str = internal constant [10 x sbyte] c"testb.cpp\00", section "llvm.metadata" ; <[10 x sbyte]*> [#uses=1]
34 %str = internal constant [32 x sbyte] c"/Sources/Projects/DwarfTesting/\00", section "llvm.metadata" ; <[32 x sbyte]*> [#uses=1]
35 %str = internal constant [45 x sbyte] c"4.0.1 LLVM (Apple Computer, Inc. build 5400)\00", section "llvm.metadata" ; <[45 x sbyte]*> [#uses=1]
36 %str = internal constant [2 x sbyte] c"x\00", section "llvm.metadata" ; <[2 x sbyte]*> [#uses=1]
37 %llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
38 uint 327716,
39 { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*),
40 sbyte* getelementptr ([4 x sbyte]* %str, int 0, int 0),
6 %llvm.dbg.anchor.type = type { i32, i32 }
7 %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
8 %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
9 %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
10 @x = global i32 0 ; [#uses=1]
11 @llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
12 i32 327732,
13 { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*),
14 { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
15 i8* getelementptr ([2 x i8]* @str, i64 0, i64 0),
16 i8* null,
17 { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
18 i32 1,
19 { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
20 i1 false,
21 i1 true,
22 { }* bitcast (i32* @x to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
23 @llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 327680, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
24 @llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
25 i32 327697,
26 { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*),
27 i32 4,
28 i8* getelementptr ([10 x i8]* @str1, i64 0, i64 0),
29 i8* getelementptr ([32 x i8]* @str2, i64 0, i64 0),
30 i8* getelementptr ([45 x i8]* @str3, i64 0, i64 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
31 @llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 327680, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
32 @str1 = internal constant [10 x i8] c"testb.cpp\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1]
33 @str2 = internal constant [32 x i8] c"/Sources/Projects/DwarfTesting/\00", section "llvm.metadata" ; <[32 x i8]*> [#uses=1]
34 @str3 = internal constant [45 x i8] c"4.0.1 LLVM (Apple Computer, Inc. build 5400)\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1]
35 @str = internal constant [2 x i8] c"x\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
36 @llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
37 i32 327716,
38 { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
39 i8* getelementptr ([4 x i8]* @str4, i64 0, i64 0),
4140 { }* null,
42 uint 0,
43 ulong 32,
44 ulong 32,
45 ulong 0,
46 uint 0,
47 uint 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
48 %str = internal constant [4 x sbyte] c"int\00", section "llvm.metadata" ; <[4 x sbyte]*> [#uses=1]
49
50 implementation ; Functions:
41 i32 0,
42 i64 32,
43 i64 32,
44 i64 0,
45 i32 0,
46 i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
47 @str4 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11 ; PR833
22
3 %G = weak global int 0 ; *> [#uses=3]
3 @G = weak global i32 0 ; *> [#uses=3]
44
5 implementation ; Functions:
6
7 int %foo(int %X) {
5 define i32 @foo(i32 %X) {
86 entry:
9 %X_addr = alloca int ; [#uses=3]
10 store int %X, int* %X_addr
11 call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,m,1,~{dirflag},~{fpsr},~{flags}"( int* %G, int* %X_addr, int* %G, int %X )
12 %tmp1 = load int* %X_addr ; [#uses=1]
13 ret int %tmp1
7 %X_addr = alloca i32 ; [#uses=3]
8 store i32 %X, i32* %X_addr
9 call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,m,1,~{dirflag},~{fpsr},~{flags}"( i32* @G, i32* %X_addr, i32* @G, i32 %X )
10 %tmp1 = load i32* %X_addr ; [#uses=1]
11 ret i32 %tmp1
1412 }
1513
16 int %foo2(int %X) {
14 define i32 @foo2(i32 %X) {
1715 entry:
18 %X_addr = alloca int ; [#uses=3]
19 store int %X, int* %X_addr
20 call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,1,~{dirflag},~{fpsr},~{flags}"( int* %G, int* %X_addr, int %X )
21 %tmp1 = load int* %X_addr ; [#uses=1]
22 ret int %tmp1
16 %X_addr = alloca i32 ; [#uses=3]
17 store i32 %X, i32* %X_addr
18 call void asm sideeffect "xchg{l} {$0,$1|$1,$0}", "=*m,=*r,1,~{dirflag},~{fpsr},~{flags}"( i32* @G, i32* %X_addr, i32 %X )
19 %tmp1 = load i32* %X_addr ; [#uses=1]
20 ret i32 %tmp1
2321 }
22
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep -- 4294967240
0 ; RUN: llvm-as < %s | llc -march=x86 | grep -- 4294967240
11 ; PR853
22
3 %X = global int* cast (ulong 18446744073709551560 to int*)
3 @X = global i32* inttoptr (i64 -56 to i32*) ; [#uses=0]
44
0 ; PR850
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att | \
1 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
22 ; RUN: grep {movl 4(%eax),%ebp}
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att | \
3 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
44 ; RUN: grep {movl 0(%eax), %ebx}
55
6 int %foo(int %__s.i.i, int %tmp5.i.i, int %tmp6.i.i, int %tmp7.i.i, int %tmp8.i.i ) {
6 define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
7 %tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i ) ; [#uses=1]
8 ret i32 %tmp9.i.i
9 }
710
8 %tmp9.i.i = call int asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"(int 192, int %__s.i.i, int %tmp5.i.i, int %tmp6.i.i, int %tmp7.i.i, int %tmp8.i.i )
9 ret int %tmp9.i.i
10 }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86
0 ; RUN: llvm-as < %s | llc -march=x86
11
2 void %_ZN13QFSFileEngine4readEPcx() {
3 %tmp201 = load int* null
4 %tmp201 = cast int %tmp201 to long
5 %tmp202 = load long* null
6 %tmp203 = add long %tmp201, %tmp202
7 store long %tmp203, long* null
2 define void @_ZN13QFSFileEngine4readEPcx() {
3 %tmp201 = load i32* null ; [#uses=1]
4 %tmp201.upgrd.1 = sext i32 %tmp201 to i64 ; [#uses=1]
5 %tmp202 = load i64* null ; [#uses=1]
6 %tmp203 = add i64 %tmp201.upgrd.1, %tmp202 ; [#uses=1]
7 store i64 %tmp203, i64* null
88 ret void
99 }
10
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep shrl
0 ; RUN: llvm-as < %s | llc -march=x86 | grep shrl
11 ; Bug in FindModifiedNodeSlot cause tmp14 load to become a zextload and shr 31
22 ; is then optimized away.
3 @tree_code_type = external global [0 x i32] ; <[0 x i32]*> [#uses=1]
34
4 %tree_code_type = external global [0 x uint]
5
6 void %copy_if_shared_r() {
7 %tmp = load uint* null
8 %tmp56 = and uint %tmp, 255
9 %tmp8 = getelementptr [0 x uint]* %tree_code_type, int 0, uint %tmp56
10 %tmp9 = load uint* %tmp8
11 %tmp10 = add uint %tmp9, 4294967295
12 %tmp = setgt uint %tmp10, 2
13 %tmp14 = load uint* null
14 %tmp15 = shr uint %tmp14, ubyte 31
15 %tmp15 = cast uint %tmp15 to ubyte
16 %tmp16 = setne ubyte %tmp15, 0
17 br bool %tmp, label %cond_false25, label %cond_true
18
19 cond_true:
20 br bool %tmp16, label %cond_true17, label %cond_false
21
22 cond_true17:
5 define void @copy_if_shared_r() {
6 %tmp = load i32* null ; [#uses=1]
7 %tmp56 = and i32 %tmp, 255 ; [#uses=1]
8 %gep.upgrd.1 = zext i32 %tmp56 to i64 ; [#uses=1]
9 %tmp8 = getelementptr [0 x i32]* @tree_code_type, i32 0, i64 %gep.upgrd.1 ; [#uses=1]
10 %tmp9 = load i32* %tmp8 ; [#uses=1]
11 %tmp10 = add i32 %tmp9, -1 ; [#uses=1]
12 %tmp.upgrd.2 = icmp ugt i32 %tmp10, 2 ; [#uses=1]
13 %tmp14 = load i32* null ; [#uses=1]
14 %tmp15 = lshr i32 %tmp14, 31 ; [#uses=1]
15 %tmp15.upgrd.3 = trunc i32 %tmp15 to i8 ; [#uses=1]
16 %tmp16 = icmp ne i8 %tmp15.upgrd.3, 0 ; [#uses=1]
17 br i1 %tmp.upgrd.2, label %cond_false25, label %cond_true
18 cond_true: ; preds = %0
19 br i1 %tmp16, label %cond_true17, label %cond_false
20 cond_true17: ; preds = %cond_true
2321 ret void
24
25 cond_false:
22 cond_false: ; preds = %cond_true
2623 ret void
27
28 cond_false25:
24 cond_false25: ; preds = %0
2925 ret void
3026 }
27
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {subl \$4, %esp}
0 ; RUN: llvm-as < %s | llc -march=x86 | grep {subl \$4, %esp}
11
22 target triple = "i686-pc-linux-gnu"
3 @str = internal constant [9 x i8] c"%f+%f*i\0A\00" ; <[9 x i8]*> [#uses=1]
34
4 %str = internal constant [9 x sbyte] c"%f+%f*i\0A\00" ; <[9 x sbyte]*> [#uses=1]
5
6 implementation ; Functions:
7
8 int %main() {
5 define i32 @main() {
96 entry:
10 %retval = alloca int, align 4 ; [#uses=1]
11 %tmp = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
12 %tmp1 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
13 %tmp2 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=3]
14 %pi = alloca double, align 8 ; [#uses=2]
15 %z = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
16 "alloca point" = cast int 0 to int ; [#uses=0]
17 store double 0x400921FB54442D18, double* %pi
18 %tmp = load double* %pi ; [#uses=1]
19 %real = getelementptr { double, double }* %tmp1, uint 0, uint 0 ; [#uses=1]
20 store double 0.000000e+00, double* %real
21 %real3 = getelementptr { double, double }* %tmp1, uint 0, uint 1 ; [#uses=1]
22 store double %tmp, double* %real3
23 %tmp = getelementptr { double, double }* %tmp, uint 0, uint 0 ; [#uses=1]
24 %tmp4 = getelementptr { double, double }* %tmp1, uint 0, uint 0 ; [#uses=1]
25 %tmp5 = load double* %tmp4 ; [#uses=1]
26 store double %tmp5, double* %tmp
27 %tmp6 = getelementptr { double, double }* %tmp, uint 0, uint 1 ; [#uses=1]
28 %tmp7 = getelementptr { double, double }* %tmp1, uint 0, uint 1 ; [#uses=1]
29 %tmp8 = load double* %tmp7 ; [#uses=1]
30 store double %tmp8, double* %tmp6
31 %tmp = cast { double, double }* %tmp to { long, long }* ; <{ long, long }*> [#uses=1]
32 %tmp = getelementptr { long, long }* %tmp, uint 0, uint 0 ; [#uses=1]
33 %tmp = load long* %tmp ; [#uses=1]
34 %tmp9 = cast { double, double }* %tmp to { long, long }* ; <{ long, long }*> [#uses=1]
35 %tmp10 = getelementptr { long, long }* %tmp9, uint 0, uint 1 ; [#uses=1]
36 %tmp11 = load long* %tmp10 ; [#uses=1]
37 call csretcc void %cexp( { double, double }* %tmp2, long %tmp, long %tmp11 )
38 %tmp12 = getelementptr { double, double }* %z, uint 0, uint 0 ; [#uses=1]
39 %tmp13 = getelementptr { double, double }* %tmp2, uint 0, uint 0 ; [#uses=1]
40 %tmp14 = load double* %tmp13 ; [#uses=1]
41 store double %tmp14, double* %tmp12
42 %tmp15 = getelementptr { double, double }* %z, uint 0, uint 1 ; [#uses=1]
43 %tmp16 = getelementptr { double, double }* %tmp2, uint 0, uint 1 ; [#uses=1]
44 %tmp17 = load double* %tmp16 ; [#uses=1]
45 store double %tmp17, double* %tmp15
46 %tmp18 = getelementptr { double, double }* %z, uint 0, uint 1 ; [#uses=1]
47 %tmp19 = load double* %tmp18 ; [#uses=1]
48 %tmp20 = getelementptr { double, double }* %z, uint 0, uint 0 ; [#uses=1]
49 %tmp21 = load double* %tmp20 ; [#uses=1]
50 %tmp = getelementptr [9 x sbyte]* %str, int 0, uint 0 ; [#uses=1]
51 %tmp = call int (sbyte*, ...)* %printf( sbyte* %tmp, double %tmp21, double %tmp19 ) ; [#uses=0]
52 br label %return
53
54 return: ; preds = %entry
55 %retval = load int* %retval ; [#uses=1]
56 ret int %retval
7 %retval = alloca i32, align 4 ; [#uses=1]
8 %tmp = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
9 %tmp1 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
10 %tmp2 = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=3]
11 %pi = alloca double, align 8 ; [#uses=2]
12 %z = alloca { double, double }, align 16 ; <{ double, double }*> [#uses=4]
13 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
14 store double 0x400921FB54442D18, double* %pi
15 %tmp.upgrd.1 = load double* %pi ; [#uses=1]
16 %real = getelementptr { double, double }* %tmp1, i64 0, i32 0 ; [#uses=1]
17 store double 0.000000e+00, double* %real
18 %real3 = getelementptr { double, double }* %tmp1, i64 0, i32 1 ; [#uses=1]
19 store double %tmp.upgrd.1, double* %real3
20 %tmp.upgrd.2 = getelementptr { double, double }* %tmp, i64 0, i32 0 ; [#uses=1]
21 %tmp4 = getelementptr { double, double }* %tmp1, i64 0, i32 0 ; [#uses=1]
22 %tmp5 = load double* %tmp4 ; [#uses=1]
23 store double %tmp5, double* %tmp.upgrd.2
24 %tmp6 = getelementptr { double, double }* %tmp, i64 0, i32 1 ; [#uses=1]
25 %tmp7 = getelementptr { double, double }* %tmp1, i64 0, i32 1 ; [#uses=1]
26 %tmp8 = load double* %tmp7 ; [#uses=1]
27 store double %tmp8, double* %tmp6
28 %tmp.upgrd.3 = bitcast { double, double }* %tmp to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
29 %tmp.upgrd.4 = getelementptr { i64, i64 }* %tmp.upgrd.3, i64 0, i32 0 ; [#uses=1]
30 %tmp.upgrd.5 = load i64* %tmp.upgrd.4 ; [#uses=1]
31 %tmp9 = bitcast { double, double }* %tmp to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
32 %tmp10 = getelementptr { i64, i64 }* %tmp9, i64 0, i32 1 ; [#uses=1]
33 %tmp11 = load i64* %tmp10 ; [#uses=1]
34 call void @cexp( { double, double }* sret %tmp2, i64 %tmp.upgrd.5, i64 %tmp11 )
35 %tmp12 = getelementptr { double, double }* %z, i64 0, i32 0 ; [#uses=1]
36 %tmp13 = getelementptr { double, double }* %tmp2, i64 0, i32 0 ; [#uses=1]
37 %tmp14 = load double* %tmp13 ; [#uses=1]
38 store double %tmp14, double* %tmp12
39 %tmp15 = getelementptr { double, double }* %z, i64 0, i32 1 ; [#uses=1]
40 %tmp16 = getelementptr { double, double }* %tmp2, i64 0, i32 1 ; [#uses=1]
41 %tmp17 = load double* %tmp16 ; [#uses=1]
42 store double %tmp17, double* %tmp15
43 %tmp18 = getelementptr { double, double }* %z, i64 0, i32 1 ; [#uses=1]
44 %tmp19 = load double* %tmp18 ; [#uses=1]
45 %tmp20 = getelementptr { double, double }* %z, i64 0, i32 0 ; [#uses=1]
46 %tmp21 = load double* %tmp20 ; [#uses=1]
47 %tmp.upgrd.6 = getelementptr [9 x i8]* @str, i32 0, i64 0 ; [#uses=1]
48 %tmp.upgrd.7 = call i32 (i8*, ...)* @printf( i8* %tmp.upgrd.6, double %tmp21, double %tmp19 ) ; [#uses=0]
49 br label %return
50 return: ; preds = %entry
51 %retval.upgrd.8 = load i32* %retval ; [#uses=1]
52 ret i32 %retval.upgrd.8
5753 }
5854
59 declare csretcc void %cexp({ double, double }*, long, long)
55 declare void @cexp({ double, double }* sret , i64, i64)
6056
61 declare int %printf(sbyte*, ...)
57 declare i32 @printf(i8*, ...)
58
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
0 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \
11 ; RUN: grep {and DWORD PTR} | count 2
22
3 target endian = little
4 target pointersize = 32
3 target datalayout = "e-p:32:32"
4 %struct.Macroblock = type { i32, i32, i32, i32, i32, [8 x i32], %struct.Macroblock*, %struct.Macroblock*, i32, [2 x [4 x [4 x [2 x i32]]]], [16 x i8], [16 x i8], i32, i64, [4 x i32], [4 x i32], i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, double, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
55
6 %struct.Macroblock = type { int, int, int, int, int, [8 x int], %struct.Macroblock*, %struct.Macroblock*, int, [2 x [4 x [4 x [2 x int]]]], [16 x sbyte], [16 x sbyte], int, long, [4 x int], [4 x int], long, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, short, double, int, int, int, int, int, int, int, int, int }
6 define internal fastcc i32 @dct_chroma(i32 %uv, i32 %cr_cbp) {
7 entry:
8 br i1 true, label %cond_true2732.preheader, label %cond_true129
9 cond_true129: ; preds = %entry
10 ret i32 0
11 cond_true2732.preheader: ; preds = %entry
12 %tmp2666 = getelementptr %struct.Macroblock* null, i32 0, i32 13 ; [#uses=2]
13 %tmp2674 = trunc i32 0 to i8 ; [#uses=1]
14 br i1 true, label %cond_true2732.preheader.split.us, label %cond_true2732.preheader.split
15 cond_true2732.preheader.split.us: ; preds = %cond_true2732.preheader
16 br i1 true, label %cond_true2732.outer.us.us, label %cond_true2732.outer.us
17 cond_true2732.outer.us.us: ; preds = %cond_true2732.preheader.split.us
18 %tmp2667.us.us = load i64* %tmp2666 ; [#uses=1]
19 %tmp2670.us.us = load i64* null ; [#uses=1]
20 %shift.upgrd.1 = zext i8 %tmp2674 to i64 ; [#uses=1]
21 %tmp2675.us.us = shl i64 %tmp2670.us.us, %shift.upgrd.1 ; [#uses=1]
22 %tmp2675not.us.us = xor i64 %tmp2675.us.us, -1 ; [#uses=1]
23 %tmp2676.us.us = and i64 %tmp2667.us.us, %tmp2675not.us.us ; [#uses=1]
24 store i64 %tmp2676.us.us, i64* %tmp2666
25 ret i32 0
26 cond_true2732.outer.us: ; preds = %cond_true2732.preheader.split.us
27 ret i32 0
28 cond_true2732.preheader.split: ; preds = %cond_true2732.preheader
29 ret i32 0
30 cond_next2752: ; No predecessors!
31 ret i32 0
32 }
733
8 implementation ; Functions:
9
10 internal fastcc int %dct_chroma(int %uv, int %cr_cbp) {
11 entry:
12 br bool true, label %cond_true2732.preheader, label %cond_true129
13
14 cond_true129: ; preds = %entry
15 ret int 0
16
17 cond_true2732.preheader: ; preds = %bb2611
18 %tmp2666 = getelementptr %struct.Macroblock* null, int 0, uint 13 ; [#uses=2]
19 %tmp2674 = cast int 0 to ubyte ; [#uses=1]
20 br bool true, label %cond_true2732.preheader.split.us, label %cond_true2732.preheader.split
21
22 cond_true2732.preheader.split.us: ; preds = %cond_true2732.preheader
23 br bool true, label %cond_true2732.outer.us.us, label %cond_true2732.outer.us
24
25 cond_true2732.outer.us.us: ; preds = %cond_true2732.preheader.split.us
26 %tmp2667.us.us = load long* %tmp2666 ; [#uses=1]
27 %tmp2670.us.us = load long* null ; [#uses=1]
28 %tmp2675.us.us = shl long %tmp2670.us.us, ubyte %tmp2674 ; [#uses=1]
29 %tmp2675not.us.us = xor long %tmp2675.us.us, -1 ; [#uses=1]
30 %tmp2676.us.us = and long %tmp2667.us.us, %tmp2675not.us.us ; [#uses=1]
31 store long %tmp2676.us.us, long* %tmp2666
32 ret int 0
33
34 cond_true2732.outer.us: ; preds = %cond_true2732.preheader.split.us
35 ret int 0
36
37 cond_true2732.preheader.split: ; preds = %cond_true2732.preheader
38 ret int 0
39
40 cond_next2752: ; preds = %bb2611
41 ret int 0
42 }
None ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
11 ; RUN: grep call | notcast
22 ; END.
33
4 implementation
54
65 ; Simple case, argument translatable without changing the value
7 declare void %test1a(sbyte *%A)
8 void %test1(int *%A) {
9 call void(int*)* cast (void(sbyte*)* %test1a to void(int*)*)(int* %A)
6 declare void @test1a(i8*)
7
8 define void @test1(i32* %A) {
9 call void bitcast (void (i8*)* @test1a to void (i32*)*)( i32* %A )
1010 ret void
1111 }
1212
1313 ; More complex case, translate argument because of resolution. This is safe
1414 ; because we have the body of the function
15 void %test2a(sbyte %A) { ret void }
16 int %test2(int %A) {
17 call void(int)* cast (void(sbyte)* %test2a to void(int)*)(int %A)
18 ret int %A
15 define void @test2a(i8 %A) {
16 ret void
1917 }
18
19 define i32 @test2(i32 %A) {
20 call void bitcast (void (i8)* @test2a to void (i32)*)( i32 %A )
21 ret i32 %A
22 }
23
2024
2125 ; Resolving this should insert a cast from sbyte to int, following the C
2226 ; promotion rules.
23 declare void %test3a(sbyte %A, ...)
24 void %test3(sbyte %A, sbyte %B) {
25 call void(sbyte, sbyte)* cast (void(sbyte,...)* %test3a to void(sbyte,sbyte)*)(sbyte %A, sbyte %B)
27 declare void @test3a(i8, ...)
28
29 define void @test3(i8 %A, i8 %B) {
30 call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B
31 )
2632 ret void
2733 }
2834
35
2936 ; test conversion of return value...
30 sbyte %test4a() { ret sbyte 0 }
31 int %test4() {
32 %X = call int()* cast (sbyte()* %test4a to int()*)()
33 ret int %X
37 define i8 @test4a() {
38 ret i8 0
3439 }
40
41 define i32 @test4() {
42 %X = call i32 bitcast (i8 ()* @test4a to i32 ()*)( ) ; [#uses=1]
43 ret i32 %X
44 }
45
3546
3647 ; test conversion of return value... no value conversion occurs so we can do
3748 ; this with just a prototype...
38 declare uint %test5a()
39 int %test5() {
40 %X = call int()* cast (uint()* %test5a to int()*)()
41 ret int %X
49 declare i32 @test5a()
50
51 define i32 @test5() {
52 %X = call i32 @test5a( ) ; [#uses=1]
53 ret i32 %X
4254 }
4355
56
4457 ; test addition of new arguments...
45 declare int %test6a(int %X)
46 int %test6() {
47 %X = call int()* cast (int(int)* %test6a to int()*)()