1 ; RUN: llc -march=hexagon -O0 < %s | FileCheck %s
3 ; CHECK: v{{[0-9]+}}:{{[0-9]+}} = vcombine(v{{[0-9]+}},v{{[0-9]+}})
5 target triple = "hexagon"
7 ; Function Attrs: nounwind
8 define void @f0(ptr nocapture readnone %a0, i32 %a1, i32 %a2, i32 %a3, ptr nocapture %a4, i32 %a5) #0 {
11 %v2 = add i32 %v1, %a1
13 %v4 = add i32 %v2, %v3
14 %v5 = tail call <16 x i32> @llvm.hexagon.V6.lvsplatw(i32 -1)
15 %v6 = tail call <16 x i32> @llvm.hexagon.V6.lvsplatw(i32 1)
16 %v7 = tail call <64 x i1> @llvm.hexagon.V6.pred.scalar2(i32 %v4)
17 %v8 = tail call <16 x i32> @llvm.hexagon.V6.vandqrt.acc(<16 x i32> %v6, <64 x i1> %v7, i32 12)
18 %v9 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v8, <16 x i32> %v8)
19 %v10 = and i32 %v4, 511
20 %v11 = icmp eq i32 %v10, 0
21 br i1 %v11, label %b1, label %b2
24 %v12 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v5, <16 x i32> %v8)
27 b2: ; preds = %b1, %b0
28 %v13 = phi <32 x i32> [ %v12, %b1 ], [ %v9, %b0 ]
29 %v14 = icmp sgt i32 %v4, 0
30 br i1 %v14, label %b3, label %b6
33 %v15 = tail call <64 x i1> @llvm.hexagon.V6.pred.scalar2(i32 %a5)
34 %v16 = tail call <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1> %v15, i32 16843009)
35 %v17 = tail call <16 x i32> @llvm.hexagon.V6.vnot(<16 x i32> %v16)
36 %v18 = add i32 %v3, %a1
37 %v19 = add i32 %v18, -1
38 %v20 = add i32 %v19, %v1
39 %v21 = lshr i32 %v20, 9
40 %v22 = mul i32 %v21, 16
41 %v23 = add nuw nsw i32 %v22, 16
42 %v24 = getelementptr i32, ptr %a4, i32 %v23
45 b4: ; preds = %b4, %b3
46 %v25 = phi i32 [ %v4, %b3 ], [ %v30, %b4 ]
47 %v26 = phi <16 x i32> [ %v17, %b3 ], [ %v5, %b4 ]
48 %v27 = phi ptr [ %a4, %b3 ], [ %v29, %b4 ]
49 %v28 = tail call <16 x i32> @llvm.hexagon.V6.vand(<16 x i32> undef, <16 x i32> %v26)
50 %v29 = getelementptr inbounds <16 x i32>, ptr %v27, i32 1
51 store <16 x i32> %v28, ptr %v27, align 64, !tbaa !0
52 %v30 = add nsw i32 %v25, -512
53 %v31 = icmp sgt i32 %v30, 0
54 br i1 %v31, label %b4, label %b5
59 b6: ; preds = %b5, %b2
60 %v33 = phi ptr [ %v24, %b5 ], [ %a4, %b2 ]
61 %v34 = load <16 x i32>, ptr %v33, align 64, !tbaa !0
62 %v35 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v13)
63 %v36 = tail call <16 x i32> @llvm.hexagon.V6.vand(<16 x i32> %v34, <16 x i32> %v35)
64 store <16 x i32> %v36, ptr %v33, align 64, !tbaa !0
68 ; Function Attrs: nounwind readnone
69 declare <16 x i32> @llvm.hexagon.V6.lvsplatw(i32) #1
71 ; Function Attrs: nounwind readnone
72 declare <64 x i1> @llvm.hexagon.V6.pred.scalar2(i32) #1
74 ; Function Attrs: nounwind readnone
75 declare <16 x i32> @llvm.hexagon.V6.vandqrt.acc(<16 x i32>, <64 x i1>, i32) #1
77 ; Function Attrs: nounwind readnone
78 declare <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32>, <16 x i32>) #1
80 ; Function Attrs: nounwind readnone
81 declare <16 x i32> @llvm.hexagon.V6.vandqrt(<64 x i1>, i32) #1
83 ; Function Attrs: nounwind readnone
84 declare <16 x i32> @llvm.hexagon.V6.vnot(<16 x i32>) #1
86 ; Function Attrs: nounwind readnone
87 declare <16 x i32> @llvm.hexagon.V6.vand(<16 x i32>, <16 x i32>) #1
89 ; Function Attrs: nounwind readnone
90 declare <16 x i32> @llvm.hexagon.V6.lo(<32 x i32>) #1
92 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
93 attributes #1 = { nounwind readnone }
96 !1 = !{!"omnipotent char", !2, i64 0}
97 !2 = !{!"Simple C/C++ TBAA"}