1 ; RUN: llc -march=hexagon -O3 < %s | FileCheck %s
2 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
3 ; RUN: llc -march=hexagon -O1 < %s | FileCheck %s
4 ; RUN: llc -march=hexagon -O0 < %s | FileCheck %s
6 ; CHECK-NOT: v{{[0-9]*}}.cur
9 ; CHECK: v{{[0-9]+}}.h = vasr(v{{[0-9]+}}.w,v{{[0-9]+}}.w,r{{[0-7]+}})
13 ; CHECK: v{{[0-9]+}}.h = vasr(v{{[0-9]+}}.w,v{{[0-9]+}}.w,r{{[0-7]+}})
16 ; CHECK: v{{[0-9]+}} = v{{[0-9]+}}
18 target triple = "hexagon"
20 ; Function Attrs: nounwind
21 define void @f0(ptr nocapture readonly %a0, ptr nocapture readonly %a1, i32 %a2, ptr nocapture %a3, i32 %a4) #0 {
23 %v1 = load i32, ptr %a1, align 4, !tbaa !0
24 %v2 = getelementptr inbounds i8, ptr %a1, i32 4
25 %v4 = load i32, ptr %v2, align 4, !tbaa !0
26 %v5 = getelementptr inbounds i8, ptr %a1, i32 8
27 %v7 = load i32, ptr %v5, align 4, !tbaa !0
29 %v9 = add i32 %v8, %a4
30 %v10 = icmp sgt i32 %a4, 0
31 br i1 %v10, label %b1, label %b4
34 %v11 = getelementptr inbounds i8, ptr %a0, i32 %v9
35 %v12 = getelementptr inbounds i8, ptr %a0, i32 %v8
36 %v13 = getelementptr inbounds i8, ptr %a0, i32 %a4
37 %v14 = add i32 %v9, 64
38 %v16 = add i32 %v8, 64
39 %v18 = add i32 %a4, 64
40 %v21 = getelementptr inbounds i8, ptr %a0, i32 %v14
41 %v22 = load <16 x i32>, ptr %v11, align 64, !tbaa !4
42 %v23 = getelementptr inbounds i8, ptr %a0, i32 %v16
43 %v24 = load <16 x i32>, ptr %v12, align 64, !tbaa !4
44 %v25 = getelementptr inbounds i8, ptr %a0, i32 %v18
45 %v26 = load <16 x i32>, ptr %v13, align 64, !tbaa !4
46 %v27 = load <16 x i32>, ptr %a0, align 64, !tbaa !4
47 %v28 = getelementptr inbounds i8, ptr %a3, i32 %a4
50 b2: ; preds = %b2, %b1
51 %v29 = phi ptr [ %a0, %b1 ], [ %v40, %b2 ]
52 %v30 = phi ptr [ %a3, %b1 ], [ %v74, %b2 ]
53 %v31 = phi ptr [ %v25, %b1 ], [ %v45, %b2 ]
54 %v32 = phi ptr [ %v23, %b1 ], [ %v48, %b2 ]
55 %v33 = phi ptr [ %v21, %b1 ], [ %v51, %b2 ]
56 %v34 = phi ptr [ %v28, %b1 ], [ %v89, %b2 ]
57 %v35 = phi i32 [ 0, %b1 ], [ %v90, %b2 ]
58 %v36 = phi <16 x i32> [ %v27, %b1 ], [ %v42, %b2 ]
59 %v37 = phi <16 x i32> [ %v26, %b1 ], [ %v44, %b2 ]
60 %v38 = phi <16 x i32> [ %v24, %b1 ], [ %v47, %b2 ]
61 %v39 = phi <16 x i32> [ %v22, %b1 ], [ %v50, %b2 ]
62 %v40 = getelementptr inbounds i8, ptr %v29, i32 64
63 %v42 = load <16 x i32>, ptr %v40, align 64, !tbaa !4
64 %v44 = load <16 x i32>, ptr %v31, align 64, !tbaa !4
65 %v45 = getelementptr inbounds i8, ptr %v31, i32 64
66 %v47 = load <16 x i32>, ptr %v32, align 64, !tbaa !4
67 %v48 = getelementptr inbounds i8, ptr %v32, i32 64
68 %v50 = load <16 x i32>, ptr %v33, align 64, !tbaa !4
69 %v51 = getelementptr inbounds i8, ptr %v33, i32 64
70 %v52 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v42, <16 x i32> %v36, i32 4)
71 %v53 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v44, <16 x i32> %v37, i32 4)
72 %v54 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v47, <16 x i32> %v38, i32 4)
73 %v55 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v50, <16 x i32> %v39, i32 4)
74 %v56 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v52, <16 x i32> %v36)
75 %v57 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v53, <16 x i32> %v37)
76 %v58 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v54, <16 x i32> %v38)
77 %v59 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v55, <16 x i32> %v39)
78 %v60 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v56, i32 %v1, i32 0)
79 %v61 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v56, i32 %v1, i32 1)
80 %v62 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v60, <32 x i32> %v57, i32 %v4, i32 0)
81 %v63 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v61, <32 x i32> %v57, i32 %v4, i32 1)
82 %v64 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v62, <32 x i32> %v58, i32 %v7, i32 0)
83 %v65 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v63, <32 x i32> %v58, i32 %v7, i32 1)
84 %v66 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v65)
85 %v67 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v65)
86 %v68 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v66, <16 x i32> %v67, i32 %a2)
87 %v69 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v64)
88 %v70 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v64)
89 %v71 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v69, <16 x i32> %v70, i32 %a2)
90 %v72 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v68, <16 x i32> %v71)
91 store <16 x i32> %v72, ptr %v30, align 64, !tbaa !4
92 %v74 = getelementptr inbounds i8, ptr %v30, i32 64
93 %v75 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v57, i32 %v1, i32 0)
94 %v76 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v57, i32 %v1, i32 1)
95 %v77 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v75, <32 x i32> %v58, i32 %v4, i32 0)
96 %v78 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v76, <32 x i32> %v58, i32 %v4, i32 1)
97 %v79 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v77, <32 x i32> %v59, i32 %v7, i32 0)
98 %v80 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v78, <32 x i32> %v59, i32 %v7, i32 1)
99 %v81 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v80)
100 %v82 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v80)
101 %v83 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v81, <16 x i32> %v82, i32 %a2)
102 %v84 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v79)
103 %v85 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v79)
104 %v86 = tail call <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32> %v84, <16 x i32> %v85, i32 %a2)
105 %v87 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v83, <16 x i32> %v86)
106 store <16 x i32> %v87, ptr %v34, align 64, !tbaa !4
107 %v89 = getelementptr inbounds i8, ptr %v34, i32 64
108 %v90 = add nsw i32 %v35, 64
109 %v91 = icmp slt i32 %v90, %a4
110 br i1 %v91, label %b2, label %b3
115 b4: ; preds = %b3, %b0
119 ; Function Attrs: nounwind readnone
120 declare <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32>, <16 x i32>, i32) #1
122 ; Function Attrs: nounwind readnone
123 declare <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32>, <16 x i32>) #1
125 ; Function Attrs: nounwind readnone
126 declare <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32>, i32, i32) #1
128 ; Function Attrs: nounwind readnone
129 declare <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32>, <32 x i32>, i32, i32) #1
131 ; Function Attrs: nounwind readnone
132 declare <16 x i32> @llvm.hexagon.V6.vasrwh(<16 x i32>, <16 x i32>, i32) #1
134 ; Function Attrs: nounwind readnone
135 declare <16 x i32> @llvm.hexagon.V6.hi(<32 x i32>) #1
137 ; Function Attrs: nounwind readnone
138 declare <16 x i32> @llvm.hexagon.V6.lo(<32 x i32>) #1
140 ; Function Attrs: nounwind readnone
141 declare <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32>, <16 x i32>) #1
143 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
144 attributes #1 = { nounwind readnone }
146 !0 = !{!1, !1, i64 0}
147 !1 = !{!"int", !2, i64 0}
148 !2 = !{!"omnipotent char", !3, i64 0}
149 !3 = !{!"Simple C/C++ TBAA"}
150 !4 = !{!2, !2, i64 0}