1; Tests to make sure intrinsics are automatically upgraded.
2; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3
4
5declare <4 x float> @llvm.x86.sse.loadu.ps(i8*) nounwind readnone
6declare <16 x i8> @llvm.x86.sse2.loadu.dq(i8*) nounwind readnone
7declare <2 x double> @llvm.x86.sse2.loadu.pd(double*) nounwind readnone
8define void @test_loadu(i8* %a, double* %b) {
9  %v0 = call <4 x float> @llvm.x86.sse.loadu.ps(i8* %a)
10  %v1 = call <16 x i8> @llvm.x86.sse2.loadu.dq(i8* %a)
11  %v2 = call <2 x double> @llvm.x86.sse2.loadu.pd(double* %b)
12
13; CHECK: load i128* {{.*}}, align 1
14; CHECK: load i128* {{.*}}, align 1
15; CHECK: load i128* {{.*}}, align 1
16  ret void
17}
18
19declare void @llvm.x86.sse.movnt.ps(i8*, <4 x float>) nounwind readnone
20declare void @llvm.x86.sse2.movnt.dq(i8*, <2 x double>) nounwind readnone
21declare void @llvm.x86.sse2.movnt.pd(i8*, <2 x double>) nounwind readnone
22declare void @llvm.x86.sse2.movnt.i(i8*, i32) nounwind readnone
23
24define void @f(<4 x float> %A, i8* %B, <2 x double> %C, i32 %D) {
25; CHECK: store{{.*}}nontemporal
26  call void @llvm.x86.sse.movnt.ps(i8* %B, <4 x float> %A)
27; CHECK: store{{.*}}nontemporal
28  call void @llvm.x86.sse2.movnt.dq(i8* %B, <2 x double> %C)
29; CHECK: store{{.*}}nontemporal
30  call void @llvm.x86.sse2.movnt.pd(i8* %B, <2 x double> %C)
31; CHECK: store{{.*}}nontemporal
32  call void @llvm.x86.sse2.movnt.i(i8* %B, i32 %D)
33  ret void
34}
35
36declare void @llvm.prefetch(i8*, i32, i32) nounwind
37
38define void @p(i8* %ptr) {
39; CHECK: llvm.prefetch(i8* %ptr, i32 0, i32 1, i32 1)
40  tail call void @llvm.prefetch(i8* %ptr, i32 0, i32 1)
41  ret void
42}
43
44declare i32 @nest_f(i8* nest, i32)
45declare i8* @llvm.init.trampoline(i8*, i8*, i8*)
46
47define void @test_trampolines() {
48; CHECK: call void @llvm.init.trampoline(i8* null, i8* bitcast (i32 (i8*, i32)* @nest_f to i8*), i8* null)
49; CHECK: call i8* @llvm.adjust.trampoline(i8* null)
50
51  call i8* @llvm.init.trampoline(i8* null,
52                                 i8* bitcast (i32 (i8*, i32)* @nest_f to i8*),
53                                 i8* null)
54  ret void
55}
56