1 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
3 ; Test that we convert 128B vcombine instructions to REG_SEQUENCE instructions.
7 define void @f0(i8* nocapture readonly %a0, i8* nocapture readonly %a1, i32 %a2, i8* nocapture %a3, i32 %a4, i32 %a5) #0 {
9 %v0 = bitcast i8* %a1 to i64*
10 %v1 = load i64, i64* %v0, align 8
12 %v3 = trunc i64 %v2 to i32
13 %v4 = trunc i64 %v1 to i32
14 %v5 = and i32 %v4, 16777215
15 %v6 = bitcast i8* %a0 to <32 x i32>*
16 %v7 = load <32 x i32>, <32 x i32>* %v6, align 128
17 %v8 = getelementptr inbounds i8, i8* %a0, i32 32
18 %v9 = bitcast i8* %v8 to <32 x i32>*
19 %v10 = load <32 x i32>, <32 x i32>* %v9, align 128
20 %v11 = tail call <64 x i32> @llvm.hexagon.V6.vcombine.128B(<32 x i32> %v10, <32 x i32> %v7)
21 %v12 = tail call <64 x i32> @llvm.hexagon.V6.vrmpybusi.128B(<64 x i32> %v11, i32 %v5, i32 0)
22 %v13 = tail call <64 x i32> @llvm.hexagon.V6.vrmpybusi.128B(<64 x i32> %v11, i32 %v3, i32 0)
23 %v14 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %v12)
24 %v15 = tail call <32 x i32> @llvm.hexagon.V6.vasrwuhsat.128B(<32 x i32> %v14, <32 x i32> %v14, i32 %a2)
25 %v16 = tail call <32 x i32> @llvm.hexagon.V6.lo.128B(<64 x i32> %v13)
26 %v17 = tail call <32 x i32> @llvm.hexagon.V6.vasrwuhsat.128B(<32 x i32> %v16, <32 x i32> %v16, i32 %a2)
27 %v18 = getelementptr inbounds i8, i8* %a3, i32 32
28 %v19 = bitcast i8* %v18 to <32 x i32>*
29 store <32 x i32> %v15, <32 x i32>* %v19, align 128
30 %v20 = bitcast i8* %a3 to <32 x i32>*
31 store <32 x i32> %v17, <32 x i32>* %v20, align 128
37 define void @f1() #0 {
39 br i1 undef, label %b1, label %b3
41 b1: ; preds = %b1, %b0
42 %v0 = phi <64 x i32> [ %v6, %b1 ], [ undef, %b0 ]
43 %v1 = tail call <64 x i32> @llvm.hexagon.V6.vmpybus.acc.128B(<64 x i32> %v0, <32 x i32> undef, i32 16843009)
44 %v2 = tail call <64 x i32> @llvm.hexagon.V6.vmpabus.acc.128B(<64 x i32> %v1, <64 x i32> undef, i32 16843009)
45 %v3 = tail call <64 x i32> @llvm.hexagon.V6.vmpabus.acc.128B(<64 x i32> %v2, <64 x i32> undef, i32 16843009)
46 %v4 = tail call <64 x i32> @llvm.hexagon.V6.vmpabus.acc.128B(<64 x i32> %v3, <64 x i32> undef, i32 16843009)
47 %v5 = tail call <64 x i32> @llvm.hexagon.V6.vcombine.128B(<32 x i32> undef, <32 x i32> undef)
48 %v6 = tail call <64 x i32> @llvm.hexagon.V6.vmpabus.acc.128B(<64 x i32> %v4, <64 x i32> %v5, i32 16843009)
49 br i1 false, label %b2, label %b1
52 %v7 = tail call <32 x i32> @llvm.hexagon.V6.lo.128B(<64 x i32> %v6)
59 ; Function Attrs: nounwind readnone
60 declare <64 x i32> @llvm.hexagon.V6.vcombine.128B(<32 x i32>, <32 x i32>) #1
62 ; Function Attrs: nounwind readnone
63 declare <64 x i32> @llvm.hexagon.V6.vrmpybusi.128B(<64 x i32>, i32, i32) #1
65 ; Function Attrs: nounwind readnone
66 declare <32 x i32> @llvm.hexagon.V6.vasrwuhsat.128B(<32 x i32>, <32 x i32>, i32) #1
68 ; Function Attrs: nounwind readnone
69 declare <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32>) #1
71 ; Function Attrs: nounwind readnone
72 declare <32 x i32> @llvm.hexagon.V6.lo.128B(<64 x i32>) #1
74 ; Function Attrs: nounwind readnone
75 declare <64 x i32> @llvm.hexagon.V6.vmpybus.acc.128B(<64 x i32>, <32 x i32>, i32) #1
77 ; Function Attrs: nounwind readnone
78 declare <64 x i32> @llvm.hexagon.V6.vmpabus.acc.128B(<64 x i32>, <64 x i32>, i32) #1
80 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length128b" }
81 attributes #1 = { nounwind readnone }