1 ; RUN: llc -march=hexagon -hexagon-bit=0 < %s | FileCheck %s
3 ; This spill should be eliminated.
4 ; CHECK-NOT: vmem(r29+#6)
6 define void @test(ptr noalias nocapture %key, ptr noalias nocapture %data1) #0 {
11 %pkey.0542 = phi ptr [ %key, %entry ], [ null, %for.body ]
12 %pdata0.0541 = phi ptr [ null, %entry ], [ %add.ptr48, %for.body ]
13 %pdata1.0540 = phi ptr [ %data1, %entry ], [ %add.ptr49, %for.body ]
14 %dAccum0.0539 = phi <64 x i32> [ undef, %entry ], [ %84, %for.body ]
15 %0 = load <32 x i32>, ptr %pkey.0542, align 128
16 %1 = load <32 x i32>, ptr %pdata0.0541, align 128
17 %2 = load <32 x i32>, ptr undef, align 128
18 %arrayidx4 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 2
19 %3 = load <32 x i32>, ptr %arrayidx4, align 128
20 %arrayidx5 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 2
21 %4 = load <32 x i32>, ptr %arrayidx5, align 128
22 %5 = load <32 x i32>, ptr null, align 128
23 %6 = load <32 x i32>, ptr undef, align 128
24 %7 = load <32 x i32>, ptr null, align 128
25 %arrayidx9 = getelementptr inbounds <32 x i32>, ptr %pkey.0542, i32 3
26 %arrayidx10 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 6
27 %8 = load <32 x i32>, ptr %arrayidx10, align 128
28 %arrayidx12 = getelementptr inbounds <32 x i32>, ptr %pkey.0542, i32 4
29 %9 = load <32 x i32>, ptr %arrayidx12, align 128
30 %arrayidx13 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 8
31 %arrayidx14 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 8
32 %10 = load <32 x i32>, ptr %arrayidx14, align 128
33 %arrayidx15 = getelementptr inbounds <32 x i32>, ptr %pkey.0542, i32 5
34 %11 = load <32 x i32>, ptr %arrayidx15, align 128
35 %arrayidx16 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 10
36 %arrayidx17 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 10
37 %12 = load <32 x i32>, ptr %arrayidx17, align 128
38 %arrayidx18 = getelementptr inbounds <32 x i32>, ptr %pkey.0542, i32 6
39 %13 = load <32 x i32>, ptr %arrayidx18, align 128
40 %arrayidx19 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 12
41 %14 = load <32 x i32>, ptr %arrayidx19, align 128
42 %arrayidx20 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 12
43 %15 = load <32 x i32>, ptr %arrayidx20, align 128
44 %arrayidx22 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 14
45 %16 = load <32 x i32>, ptr %arrayidx22, align 128
46 %arrayidx23 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 14
47 %17 = load <32 x i32>, ptr %arrayidx23, align 128
48 %18 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %0, <32 x i32> %9)
49 %19 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %18, <32 x i32> %9, <32 x i32> %0)
50 %20 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %18, <32 x i32> %0, <32 x i32> %9)
51 %21 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %18, <32 x i32> undef, <32 x i32> %1)
52 %22 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %18, <32 x i32> %10, <32 x i32> undef)
53 %23 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %5, <32 x i32> %13)
54 %24 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %13, <32 x i32> %5)
55 %25 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %5, <32 x i32> %13)
56 %26 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %14, <32 x i32> %6)
57 %27 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %6, <32 x i32> %14)
58 %28 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %15, <32 x i32> %7)
59 %29 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %23, <32 x i32> %7, <32 x i32> %15)
60 %30 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %2, <32 x i32> %11)
61 %31 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> %11, <32 x i32> %2)
62 %32 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> %2, <32 x i32> %11)
63 %33 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> undef, <32 x i32> %3)
64 %34 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> %3, <32 x i32> undef)
65 %35 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> %12, <32 x i32> %4)
66 %36 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %30, <32 x i32> %4, <32 x i32> %12)
67 %37 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> zeroinitializer, <32 x i32> undef)
68 %38 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> undef, <32 x i32> zeroinitializer)
69 %39 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> %16, <32 x i32> %8)
70 %40 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> %8, <32 x i32> %16)
71 %41 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> %17, <32 x i32> undef)
72 %42 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> zeroinitializer, <32 x i32> undef, <32 x i32> %17)
73 %43 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %19, <32 x i32> %24)
74 %44 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %24, <32 x i32> %19)
75 %45 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %19, <32 x i32> %24)
76 %46 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %26, <32 x i32> %21)
77 %47 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %21, <32 x i32> %26)
78 %48 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %28, <32 x i32> %22)
79 %49 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %43, <32 x i32> %22, <32 x i32> %28)
80 %50 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %20, <32 x i32> %25)
81 %51 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %50, <32 x i32> %25, <32 x i32> %20)
82 %52 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %50, <32 x i32> %20, <32 x i32> %25)
83 %53 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %50, <32 x i32> %27, <32 x i32> undef)
84 %54 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %50, <32 x i32> undef, <32 x i32> %29)
85 %55 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %31, <32 x i32> %37)
86 %56 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %55, <32 x i32> %37, <32 x i32> %31)
87 %57 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %55, <32 x i32> %31, <32 x i32> %37)
88 %58 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %55, <32 x i32> %39, <32 x i32> %33)
89 %59 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %55, <32 x i32> %41, <32 x i32> %35)
90 %60 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %32, <32 x i32> %38)
91 %61 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %60, <32 x i32> %40, <32 x i32> %34)
92 %62 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %60, <32 x i32> %36, <32 x i32> %42)
93 %63 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %44, <32 x i32> %56)
94 %64 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %63, <32 x i32> %56, <32 x i32> %44)
95 %65 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %63, <32 x i32> %58, <32 x i32> %46)
96 %66 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %63, <32 x i32> %59, <32 x i32> %48)
97 %67 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %45, <32 x i32> %57)
98 %68 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %67, <32 x i32> %49, <32 x i32> zeroinitializer)
99 %69 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %51, <32 x i32> zeroinitializer)
100 %70 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %69, <32 x i32> %61, <32 x i32> %53)
101 %71 = tail call <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32> %52, <32 x i32> undef)
102 %72 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1> %71, <32 x i32> %54, <32 x i32> %62)
103 %73 = tail call <32 x i32> @llvm.hexagon.V6.vshuffeb.128B(<32 x i32> %66, <32 x i32> %65)
104 %74 = tail call <32 x i32> @llvm.hexagon.V6.vshuffeb.128B(<32 x i32> %68, <32 x i32> undef)
105 %75 = tail call <32 x i32> @llvm.hexagon.V6.vshuffeb.128B(<32 x i32> zeroinitializer, <32 x i32> %70)
106 %76 = tail call <32 x i32> @llvm.hexagon.V6.vshuffeb.128B(<32 x i32> %72, <32 x i32> zeroinitializer)
107 %77 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %dAccum0.0539, <32 x i32> %73, i32 65537)
108 %78 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %77, <32 x i32> zeroinitializer, i32 65537)
109 %79 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %78, <32 x i32> zeroinitializer, i32 65537)
110 %80 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %79, <32 x i32> %74, i32 65537)
111 %81 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %80, <32 x i32> %75, i32 65537)
112 %82 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %81, <32 x i32> zeroinitializer, i32 65537)
113 %83 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %82, <32 x i32> undef, i32 65537)
114 %84 = tail call <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32> %83, <32 x i32> %76, i32 65537)
115 store <32 x i32> %64, ptr %pkey.0542, align 128
116 store <32 x i32> %73, ptr %pdata0.0541, align 128
117 store <32 x i32> zeroinitializer, ptr %arrayidx4, align 128
118 store <32 x i32> zeroinitializer, ptr undef, align 128
119 store <32 x i32> zeroinitializer, ptr %arrayidx20, align 128
120 store <32 x i32> zeroinitializer, ptr null, align 128
121 %add.ptr48 = getelementptr inbounds <32 x i32>, ptr %pdata0.0541, i32 16
122 %add.ptr49 = getelementptr inbounds <32 x i32>, ptr %pdata1.0540, i32 16
123 br i1 false, label %for.end, label %for.body
126 %85 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %84)
130 declare <128 x i1> @llvm.hexagon.V6.vgtb.128B(<32 x i32>, <32 x i32>) #1
132 declare <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1>, <32 x i32>, <32 x i32>) #1
134 declare <32 x i32> @llvm.hexagon.V6.vshuffeb.128B(<32 x i32>, <32 x i32>) #1
136 declare <64 x i32> @llvm.hexagon.V6.vmpyuh.acc.128B(<64 x i32>, <32 x i32>, i32) #1
138 declare <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32>) #1
140 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length128b" }
141 attributes #1 = { nounwind readnone }