1 ; RUN: llc -march=hexagon -O3 -disable-hexagon-amodeopt < %s | FileCheck %s --check-prefix=CHECK-NO-AMODE
2 ; RUN: llc -march=hexagon -O3 < %s | FileCheck %s --check-prefix=CHECK-AMODE
4 ; CHECK-NO-AMODE: [[REG1:(r[0-9]+)]] = add({{r[0-9]+}},#0)
6 ; CHECK-NO-AMODE: [[REG2:(r[0-9]+)]] = add([[REG1]],#128)
7 ; CHECK-NO-AMODE: [[REG3:(r[0-9]+)]] = add([[REG1]],#256)
8 ; CHECK-NO-AMODE: [[REG4:(r[0-9]+)]] = add([[REG1]],#384)
9 ; CHECK-NO-AMODE: [[REG5:(r[0-9]+)]] = add([[REG1]],#512)
10 ; CHECK-NO-AMODE: [[REG6:(r[0-9]+)]] = add([[REG1]],#640)
11 ; CHECK-NO-AMODE: vmem([[REG1]]+#0) = vtmp.new
12 ; CHECK-NO-AMODE: vmem([[REG2]]+#0) = vtmp.new
13 ; CHECK-NO-AMODE: vmem([[REG3]]+#0) = vtmp.new
14 ; CHECK-NO-AMODE: vmem([[REG4]]+#0) = vtmp.new
15 ; CHECK-NO-AMODE: vmem([[REG5]]+#0) = vtmp.new
16 ; CHECK-NO-AMODE: vmem([[REG6]]+#0) = vtmp.new
19 ; CHECK-AMODE: [[REG1:(r[0-9]+)]] = add({{r[0-9]+}},#0)
20 ; CHECK-AMODE-NOT: {{r[0-9]+}} = add([[REG1]],{{[0-9]+}})
21 ; CHECK-AMODE: vmem([[REG1]]+#0) = vtmp.new
22 ; CHECK-AMODE: vmem([[REG1]]+#1) = vtmp.new
23 ; CHECK-AMODE: vmem([[REG1]]+#2) = vtmp.new
24 ; CHECK-AMODE: vmem([[REG1]]+#3) = vtmp.new
25 ; CHECK-AMODE: vmem([[REG1]]+#4) = vtmp.new
26 ; CHECK-AMODE: vmem([[REG1]]+#5) = vtmp.new
28 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
29 target triple = "hexagon"
31 ; Function Attrs: nounwind readnone
32 define dso_local void @contiguos_vgather_test(i32 %Rb, i32 %mu, i32 %nloops, <32 x i32> %Vv, <64 x i32> %Vvv, <32 x i32> %Qs) local_unnamed_addr #0 {
34 %Vout1 = alloca <32 x i32>, align 128
35 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %Vout1) #2
36 %cmp23 = icmp sgt i32 %nloops, 0
37 br i1 %cmp23, label %for.body.lr.ph, label %for.cond.cleanup
39 for.body.lr.ph: ; preds = %entry
40 %add.ptr = getelementptr inbounds <32 x i32>, ptr %Vout1, i32 1
41 %add.ptr1 = getelementptr inbounds <32 x i32>, ptr %Vout1, i32 2
42 %add.ptr2 = getelementptr inbounds <32 x i32>, ptr %Vout1, i32 3
43 %0 = tail call <128 x i1> @llvm.hexagon.V6.vandvrt.128B(<32 x i32> %Qs, i32 -1)
44 %add.ptr3 = getelementptr inbounds <32 x i32>, ptr %Vout1, i32 4
45 %add.ptr4 = getelementptr inbounds <32 x i32>, ptr %Vout1, i32 5
48 for.cond.cleanup: ; preds = %for.body, %entry
49 call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %Vout1) #2
52 for.body: ; preds = %for.body, %for.body.lr.ph
53 %i.024 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
54 call void @llvm.hexagon.V6.vgathermh.128B(ptr nonnull %Vout1, i32 %Rb, i32 %mu, <32 x i32> %Vv)
55 call void @llvm.hexagon.V6.vgathermw.128B(ptr nonnull %add.ptr, i32 %Rb, i32 %mu, <32 x i32> %Vv)
56 call void @llvm.hexagon.V6.vgathermhw.128B(ptr nonnull %add.ptr1, i32 %Rb, i32 %mu, <64 x i32> %Vvv)
57 call void @llvm.hexagon.V6.vgathermhq.128B(ptr nonnull %add.ptr2, <128 x i1> %0, i32 %Rb, i32 %mu, <32 x i32> %Vv)
58 call void @llvm.hexagon.V6.vgathermwq.128B(ptr nonnull %add.ptr3, <128 x i1> %0, i32 %Rb, i32 %mu, <32 x i32> %Vv)
59 call void @llvm.hexagon.V6.vgathermhwq.128B(ptr nonnull %add.ptr4, <128 x i1> %0, i32 %Rb, i32 %mu, <64 x i32> %Vvv)
60 %inc = add nuw nsw i32 %i.024, 1
61 %exitcond = icmp eq i32 %inc, %nloops
62 br i1 %exitcond, label %for.cond.cleanup, label %for.body
65 ; Function Attrs: argmemonly nounwind
66 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
68 ; Function Attrs: argmemonly nounwind
69 declare void @llvm.hexagon.V6.vgathermh.128B(ptr, i32, i32, <32 x i32>) #1
71 ; Function Attrs: argmemonly nounwind
72 declare void @llvm.hexagon.V6.vgathermw.128B(ptr, i32, i32, <32 x i32>) #1
74 ; Function Attrs: argmemonly nounwind
75 declare void @llvm.hexagon.V6.vgathermhw.128B(ptr, i32, i32, <64 x i32>) #1
77 ; Function Attrs: argmemonly nounwind
78 declare void @llvm.hexagon.V6.vgathermhq.128B(ptr, <128 x i1>, i32, i32, <32 x i32>) #1
80 ; Function Attrs: argmemonly nounwind
81 declare void @llvm.hexagon.V6.vgathermwq.128B(ptr, <128 x i1>, i32, i32, <32 x i32>) #1
83 ; Function Attrs: argmemonly nounwind
84 declare void @llvm.hexagon.V6.vgathermhwq.128B(ptr, <128 x i1>, i32, i32, <64 x i32>) #1
86 ; Function Attrs: argmemonly nounwind
87 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
89 declare <128 x i1> @llvm.hexagon.V6.vandvrt.128B(<32 x i32>, i32) #1
91 attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv65" "target-features"="+hvx-length128b,+hvxv65,-long-calls" "unsafe-fp-math"="false" "use-soft-float"="false" }
92 attributes #1 = { argmemonly nounwind }
93 attributes #2 = { nounwind }
95 !llvm.module.flags = !{!0}
97 !0 = !{i32 1, !"wchar_size", i32 4}