1; RUN: llc -march=hexagon < %s | FileCheck %s
2
3; Test that we generate a .cur
4
5; CHECK: v{{[0-9]*}}.cur
6
7; Function Attrs: nounwind
8define void @f0(i8* noalias nocapture readonly %a0, i32 %a1, i32 %a2, <16 x i32>* %a3, <16 x i32>* %a4) #0 {
9b0:
10  br i1 undef, label %b1, label %b3
11
12b1:                                               ; preds = %b0
13  br label %b2
14
15b2:                                               ; preds = %b2, %b1
16  %v0 = phi i8* [ %a0, %b1 ], [ %v4, %b2 ]
17  %v1 = phi i32 [ 0, %b1 ], [ %v23, %b2 ]
18  %v2 = phi <16 x i32> [ zeroinitializer, %b1 ], [ %v6, %b2 ]
19  %v3 = phi <16 x i32> [ zeroinitializer, %b1 ], [ zeroinitializer, %b2 ]
20  %v4 = getelementptr inbounds i8, i8* %v0, i32 64
21  %v5 = bitcast i8* %v4 to <16 x i32>*
22  %v6 = load <16 x i32>, <16 x i32>* %v5, align 64, !tbaa !0
23  %v7 = load <16 x i32>, <16 x i32>* %a3, align 64, !tbaa !0
24  %v8 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v6, <16 x i32> %v2, i32 4)
25  %v9 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> zeroinitializer, <16 x i32> %v3, i32 4)
26  %v10 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v7, <16 x i32> zeroinitializer, i32 4)
27  %v11 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v8, <16 x i32> %v2)
28  %v12 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v10, <16 x i32> zeroinitializer)
29  %v13 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v11, i32 0, i32 0)
30  %v14 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v13, <32 x i32> zeroinitializer, i32 undef, i32 0)
31  %v15 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v14, <32 x i32> undef, i32 undef, i32 0)
32  %v16 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v15)
33  %v17 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v16, <16 x i32> undef, i32 %a1)
34  %v18 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> undef, <16 x i32> %v17)
35  store <16 x i32> %v18, <16 x i32>* %a3, align 64, !tbaa !0
36  %v19 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> zeroinitializer, <32 x i32> %v12, i32 undef, i32 1)
37  %v20 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v19)
38  %v21 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v20, <16 x i32> undef, i32 %a1)
39  %v22 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v21, <16 x i32> undef)
40  store <16 x i32> %v22, <16 x i32>* %a4, align 64, !tbaa !0
41  %v23 = add nsw i32 %v1, 64
42  %v24 = icmp slt i32 %v23, %a2
43  br i1 %v24, label %b2, label %b3
44
45b3:                                               ; preds = %b2, %b0
46  ret void
47}
48
49declare <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32>, <16 x i32>, i32) #1
50declare <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32>, <16 x i32>) #1
51declare <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32>, i32, i32) #1
52declare <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32>, <32 x i32>, i32, i32) #1
53declare <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32>, <16 x i32>, i32) #1
54declare <16 x i32> @llvm.hexagon.V6.hi(<32 x i32>) #1
55declare <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32>, <16 x i32>) #1
56
57attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
58attributes #1 = { nounwind readnone }
59
60!0 = !{!1, !1, i64 0}
61!1 = !{!"omnipotent char", !2, i64 0}
62!2 = !{!"Simple C/C++ TBAA"}
63