1 ; RUN: opt -S -instcombine < %s | FileCheck %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 declare <4 x double> @llvm.ppc.qpx.qvlfs(i8*) #1
7 define <4 x double> @test1(<4 x float>* %h) #0 {
9 %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1
10 %hv = bitcast <4 x float>* %h1 to i8*
11 %vl = call <4 x double> @llvm.ppc.qpx.qvlfs(i8* %hv)
14 ; CHECK: @llvm.ppc.qpx.qvlfs
15 ; CHECK: ret <4 x double>
17 %v0 = load <4 x float>, <4 x float>* %h, align 8
18 %v0e = fpext <4 x float> %v0 to <4 x double>
19 %a = fadd <4 x double> %v0e, %vl
23 define <4 x double> @test1a(<4 x float>* align 16 %h) #0 {
25 %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1
26 %hv = bitcast <4 x float>* %h1 to i8*
27 %vl = call <4 x double> @llvm.ppc.qpx.qvlfs(i8* %hv)
29 ; CHECK-LABEL: @test1a
30 ; CHECK-NOT: @llvm.ppc.qpx.qvlfs
31 ; CHECK: ret <4 x double>
33 %v0 = load <4 x float>, <4 x float>* %h, align 8
34 %v0e = fpext <4 x float> %v0 to <4 x double>
35 %a = fadd <4 x double> %v0e, %vl
39 declare void @llvm.ppc.qpx.qvstfs(<4 x double>, i8*) #0
41 define <4 x float> @test2(<4 x float>* %h, <4 x double> %d) #0 {
43 %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1
44 %hv = bitcast <4 x float>* %h1 to i8*
45 call void @llvm.ppc.qpx.qvstfs(<4 x double> %d, i8* %hv)
47 %v0 = load <4 x float>, <4 x float>* %h, align 8
51 ; CHECK: @llvm.ppc.qpx.qvstfs
52 ; CHECK: ret <4 x float>
55 define <4 x float> @test2a(<4 x float>* align 16 %h, <4 x double> %d) #0 {
57 %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1
58 %hv = bitcast <4 x float>* %h1 to i8*
59 call void @llvm.ppc.qpx.qvstfs(<4 x double> %d, i8* %hv)
61 %v0 = load <4 x float>, <4 x float>* %h, align 8
65 ; CHECK-NOT: @llvm.ppc.qpx.qvstfs
66 ; CHECK: ret <4 x float>
69 declare <4 x double> @llvm.ppc.qpx.qvlfd(i8*) #1
71 define <4 x double> @test1l(<4 x double>* %h) #0 {
73 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
74 %hv = bitcast <4 x double>* %h1 to i8*
75 %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv)
77 ; CHECK-LABEL: @test1l
78 ; CHECK: @llvm.ppc.qpx.qvlfd
79 ; CHECK: ret <4 x double>
81 %v0 = load <4 x double>, <4 x double>* %h, align 8
82 %a = fadd <4 x double> %v0, %vl
86 define <4 x double> @test1ln(<4 x double>* align 16 %h) #0 {
88 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
89 %hv = bitcast <4 x double>* %h1 to i8*
90 %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv)
92 ; CHECK-LABEL: @test1ln
93 ; CHECK: @llvm.ppc.qpx.qvlfd
94 ; CHECK: ret <4 x double>
96 %v0 = load <4 x double>, <4 x double>* %h, align 8
97 %a = fadd <4 x double> %v0, %vl
101 define <4 x double> @test1la(<4 x double>* align 32 %h) #0 {
103 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
104 %hv = bitcast <4 x double>* %h1 to i8*
105 %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv)
107 ; CHECK-LABEL: @test1la
108 ; CHECK-NOT: @llvm.ppc.qpx.qvlfd
109 ; CHECK: ret <4 x double>
111 %v0 = load <4 x double>, <4 x double>* %h, align 8
112 %a = fadd <4 x double> %v0, %vl
116 declare void @llvm.ppc.qpx.qvstfd(<4 x double>, i8*) #0
118 define <4 x double> @test2l(<4 x double>* %h, <4 x double> %d) #0 {
120 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
121 %hv = bitcast <4 x double>* %h1 to i8*
122 call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv)
124 %v0 = load <4 x double>, <4 x double>* %h, align 8
127 ; CHECK-LABEL: @test2l
128 ; CHECK: @llvm.ppc.qpx.qvstfd
129 ; CHECK: ret <4 x double>
132 define <4 x double> @test2ln(<4 x double>* align 16 %h, <4 x double> %d) #0 {
134 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
135 %hv = bitcast <4 x double>* %h1 to i8*
136 call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv)
138 %v0 = load <4 x double>, <4 x double>* %h, align 8
141 ; CHECK-LABEL: @test2ln
142 ; CHECK: @llvm.ppc.qpx.qvstfd
143 ; CHECK: ret <4 x double>
146 define <4 x double> @test2la(<4 x double>* align 32 %h, <4 x double> %d) #0 {
148 %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1
149 %hv = bitcast <4 x double>* %h1 to i8*
150 call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv)
152 %v0 = load <4 x double>, <4 x double>* %h, align 8
155 ; CHECK-LABEL: @test2l
156 ; CHECK-NOT: @llvm.ppc.qpx.qvstfd
157 ; CHECK: ret <4 x double>
160 attributes #0 = { nounwind }
161 attributes #1 = { nounwind readonly }