llvm.org GIT mirror llvm / 687bcb2
Add nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50837 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 11 years ago
25 changed file(s) with 39 addition(s) and 58 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
11
2 define <4 x float> @opRSQ(<4 x float> %a) {
2 define <4 x float> @opRSQ(<4 x float> %a) nounwind {
33 entry:
44 %tmp2 = extractelement <4 x float> %a, i32 3 ; [#uses=2]
55 %abscond = fcmp oge float %tmp2, -0.000000e+00 ; [#uses=1]
1515 ;
1616 ; Which is ugly. We need to fix this.
1717
18 define <2 x i32> @qux(i32 %A) {
18 define <2 x i32> @qux(i32 %A) nounwind {
1919 entry:
2020 %tmp3 = insertelement <2 x i32> < i32 0, i32 undef >, i32 %A, i32 1 ; <<2 x i32>> [#uses=1]
2121 ret <2 x i32> %tmp3
0 ; RUN: llvm-as < %s | llc -march=x86-64 | not grep mov
11
2 define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
3 {
2 define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
43 %t = load <4 x float>* %p
54 %z = mul <4 x float> %t, %x
65 ret <4 x float> %z
76 }
8 define <2 x double> @bar(<2 x double>* %p, <2 x double> %x)
9 {
7 define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
108 %t = load <2 x double>* %p
119 %z = mul <2 x double> %t, %x
1210 ret <2 x double> %z
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
11
2 define <4 x float> @foo(<4 x float>* %p)
3 {
2 define <4 x float> @foo(<4 x float>* %p) nounwind {
43 %t = load <4 x float>* %p
54 ret <4 x float> %t
65 }
7 define <2 x double> @bar(<2 x double>* %p)
8 {
6 define <2 x double> @bar(<2 x double>* %p) nounwind {
97 %t = load <2 x double>* %p
108 ret <2 x double> %t
119 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
2 define <2 x i64> @bar(<2 x i64>* %p)
3 {
2 define <2 x i64> @bar(<2 x i64>* %p) nounwind {
43 %t = load <2 x i64>* %p, align 8
54 ret <2 x i64> %t
65 }
0 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin8 | grep movaps
11 ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=linux | grep movups
22
3 define <4 x float> @foo(float %a, float %b, float %c, float %d) {
3 define <4 x float> @foo(float %a, float %b, float %c, float %d) nounwind {
44 entry:
55 %tmp6 = insertelement <4 x float> undef, float %a, i32 0
66 %tmp7 = insertelement <4 x float> %tmp6, float %b, i32 1
33 ; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | count 4
44 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 4
55
6 define <4 x float> @a(<4 x float>* %y)
7 {
6 define <4 x float> @a(<4 x float>* %y) nounwind {
87 %x = load <4 x float>* %y, align 4
98 %a = extractelement <4 x float> %x, i32 0
109 %b = extractelement <4 x float> %x, i32 1
1615 %s = insertelement <4 x float> %r, float %a, i32 3
1716 ret <4 x float> %s
1817 }
19 define <4 x float> @b(<4 x float>* %y, <4 x float> %z)
20 {
18 define <4 x float> @b(<4 x float>* %y, <4 x float> %z) nounwind {
2119 %x = load <4 x float>* %y, align 4
2220 %a = extractelement <4 x float> %x, i32 2
2321 %b = extractelement <4 x float> %x, i32 3
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
2 define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
3 {
2 define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
43 %t = load <4 x float>* %p, align 4
54 %z = mul <4 x float> %t, %x
65 ret <4 x float> %z
76 }
8 define <2 x double> @bar(<2 x double>* %p, <2 x double> %x)
9 {
7 define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
108 %t = load <2 x double>* %p, align 8
119 %z = mul <2 x double> %t, %x
1210 ret <2 x double> %z
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
11
2 define void @foo(<4 x float>* %p, <4 x float> %x)
3 {
2 define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
43 store <4 x float> %x, <4 x float>* %p
54 ret void
65 }
7 define void @bar(<2 x double>* %p, <2 x double> %x)
8 {
6 define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
97 store <2 x double> %x, <2 x double>* %p
108 ret void
119 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
2 define void @foo(<4 x float>* %p, <4 x float> %x)
3 {
2 define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
43 store <4 x float> %x, <4 x float>* %p, align 4
54 ret void
65 }
7 define void @bar(<2 x double>* %p, <2 x double> %x)
8 {
6 define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
97 store <2 x double> %x, <2 x double>* %p, align 8
108 ret void
119 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
11
2 define <2 x i64> @bar(<2 x i64>* %p)
3 {
2 define <2 x i64> @bar(<2 x i64>* %p) nounwind {
43 %t = load <2 x i64>* %p
54 ret <2 x i64> %t
65 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
2 define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x)
3 {
2 define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
43 %t = load <2 x i64>* %p, align 8
54 %z = mul <2 x i64> %t, %x
65 ret <2 x i64> %z
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
11
2 define void @bar(<2 x i64>* %p, <2 x i64> %x)
3 {
2 define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
43 store <2 x i64> %x, <2 x i64>* %p
54 ret void
65 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
2 define void @bar(<2 x i64>* %p, <2 x i64> %x)
3 {
2 define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
43 store <2 x i64> %x, <2 x i64>* %p, align 8
54 ret void
65 }
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
2 define <4 x float> @foo(<4 x float>* %p)
3 {
2 define <4 x float> @foo(<4 x float>* %p) nounwind {
43 %t = load <4 x float>* %p, align 4
54 ret <4 x float> %t
65 }
7 define <2 x double> @bar(<2 x double>* %p)
8 {
6 define <2 x double> @bar(<2 x double>* %p) nounwind {
97 %t = load <2 x double>* %p, align 8
108 ret <2 x double> %t
119 }
66
77 @G = external global { float,float,float,float}, align 16
88
9 define %f4 @test1(float %W, float %X, float %Y, float %Z) {
9 define %f4 @test1(float %W, float %X, float %Y, float %Z) nounwind {
1010 %tmp = insertelement %f4 undef, float %W, i32 0
1111 %tmp2 = insertelement %f4 %tmp, float %X, i32 1
1212 %tmp4 = insertelement %f4 %tmp2, float %Y, i32 2
1414 ret %f4 %tmp6
1515 }
1616
17 define %f4 @test2() {
17 define %f4 @test2() nounwind {
1818 %Wp = getelementptr { float,float,float,float}* @G, i32 0, i32 0
1919 %Xp = getelementptr { float,float,float,float}* @G, i32 0, i32 1
2020 %Yp = getelementptr { float,float,float,float}* @G, i32 0, i32 2
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
11 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 1
22
3 define <4 x float> @test1(float %a) {
3 define <4 x float> @test1(float %a) nounwind {
44 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
55 %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
66 %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
88 ret <4 x float> %tmp7
99 }
1010
11 define <2 x i64> @test(i32 %a) {
11 define <2 x i64> @test(i32 %a) nounwind {
1212 %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<8 x i16>> [#uses=1]
1313 %tmp6 = insertelement <4 x i32> %tmp, i32 0, i32 1 ; <<8 x i32>> [#uses=1]
1414 %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<8 x i32>> [#uses=1]
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 2
11
2 define <2 x i64> @test(i16 %a) {
2 define <2 x i64> @test(i16 %a) nounwind {
33 entry:
44 %tmp10 = insertelement <8 x i16> zeroinitializer, i16 %a, i32 3 ; <<8 x i16>> [#uses=1]
55 %tmp12 = insertelement <8 x i16> %tmp10, i16 0, i32 4 ; <<8 x i16>> [#uses=1]
1010 ret <2 x i64> %tmp19
1111 }
1212
13 define <2 x i64> @test2(i8 %a) {
13 define <2 x i64> @test2(i8 %a) nounwind {
1414 entry:
1515 %tmp24 = insertelement <16 x i8> zeroinitializer, i8 %a, i32 10 ; <<16 x i8>> [#uses=1]
1616 %tmp26 = insertelement <16 x i8> %tmp24, i8 0, i32 11 ; <<16 x i8>> [#uses=1]
33 ; RUN: grep punpckldq %t | count 1
44 ; RUN: grep movq %t | count 1
55
6 define <4 x float> @test1(float %a, float %b) {
6 define <4 x float> @test1(float %a, float %b) nounwind {
77 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
88 %tmp6 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
99 %tmp8 = insertelement <4 x float> %tmp6, float %b, i32 2 ; <<4 x float>> [#uses=1]
1111 ret <4 x float> %tmp9
1212 }
1313
14 define <4 x float> @test2(float %a, float %b) {
14 define <4 x float> @test2(float %a, float %b) nounwind {
1515 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
1616 %tmp7 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
1717 %tmp8 = insertelement <4 x float> %tmp7, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
1919 ret <4 x float> %tmp9
2020 }
2121
22 define <2 x i64> @test3(i32 %a, i32 %b) {
22 define <2 x i64> @test3(i32 %a, i32 %b) nounwind {
2323 %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<4 x i32>> [#uses=1]
2424 %tmp6 = insertelement <4 x i32> %tmp, i32 %b, i32 1 ; <<4 x i32>> [#uses=1]
2525 %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<4 x i32>> [#uses=1]
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd | count 1
11
2 define <2 x i64> @test(<2 x i64>* %p) {
2 define <2 x i64> @test(<2 x i64>* %p) nounwind {
33 %tmp = bitcast <2 x i64>* %p to double*
44 %tmp.upgrd.1 = load double* %tmp
55 %tmp.upgrd.2 = insertelement <2 x double> undef, double %tmp.upgrd.1, i32 0
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 1
11 ; RUN: llvm-as < %s | llc -march=x86-64 | grep {punpcklqdq.*%xmm0, %xmm0}
22
3 define <2 x i64> @test3(i64 %A) {
3 define <2 x i64> @test3(i64 %A) nounwind {
44 entry:
55 %B = insertelement <2 x i64> undef, i64 %A, i32 1
66 ret <2 x i64> %B
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {movl.*\$1, %}
1 define <2 x i64> @test1() {
1 define <2 x i64> @test1() nounwind {
22 entry:
33 ret <2 x i64> < i64 1, i64 0 >
44 }
77 ; movd %eax, %xmm0
88 ; ret
99
10 define <2 x i64> @test3(i64 %arg) {
10 define <2 x i64> @test3(i64 %arg) nounwind {
1111 entry:
1212 %A = and i64 %arg, 1234567
1313 %B = insertelement <2 x i64> zeroinitializer, i64 %A, i32 0
1414 ret <2 x i64> %B
1515 }
1616
17 define <2 x i64> @test2(i64 %arg) {
17 define <2 x i64> @test2(i64 %arg) nounwind {
1818 entry:
1919 %A = and i64 %arg, 1234567
2020 %B = insertelement <2 x i64> undef, i64 %A, i32 0
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep punpckl | count 7
11
2 define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) {
2 define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) nounwind {
33 %tmp = insertelement <8 x i16> zeroinitializer, i16 %a0, i32 0 ; <<8 x i16>> [#uses=1]
44 %tmp2 = insertelement <8 x i16> %tmp, i16 %a1, i32 1 ; <<8 x i16>> [#uses=1]
55 %tmp4 = insertelement <8 x i16> %tmp2, i16 %a2, i32 2 ; <<8 x i16>> [#uses=1]
44 target datalayout = "e-p:32:32"
55 target triple = "i686-apple-darwin8.7.2"
66
7 define i16 @test1(float %f) {
7 define i16 @test1(float %f) nounwind {
88 %tmp = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
99 %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
1010 %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
1818 ret i16 %tmp69
1919 }
2020
21 define i16 @test2(float %f) {
21 define i16 @test2(float %f) nounwind {
2222 %tmp28 = sub float %f, 1.000000e+00 ; [#uses=1]
2323 %tmp37 = mul float %tmp28, 5.000000e-01 ; [#uses=1]
2424 %tmp375 = insertelement <4 x float> undef, float %tmp37, i32 0 ; <<4 x float>> [#uses=1]