• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
2; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3
4; Tests whether a load chain of 8 constants gets vectorized into a wider load.
5; FUNC-LABEL: {{^}}constant_load_v8f32:
6; GCN: s_load_dwordx8
7; EG: VTX_READ_128
8; EG: VTX_READ_128
9define amdgpu_kernel void @constant_load_v8f32(float addrspace(4)* noalias nocapture readonly %weights, float addrspace(1)* noalias nocapture %out_ptr) {
10entry:
11  %out_ptr.promoted = load float, float addrspace(1)* %out_ptr, align 4
12  %tmp = load float, float addrspace(4)* %weights, align 4
13  %add = fadd float %tmp, %out_ptr.promoted
14  %arrayidx.1 = getelementptr inbounds float, float addrspace(4)* %weights, i64 1
15  %tmp1 = load float, float addrspace(4)* %arrayidx.1, align 4
16  %add.1 = fadd float %tmp1, %add
17  %arrayidx.2 = getelementptr inbounds float, float addrspace(4)* %weights, i64 2
18  %tmp2 = load float, float addrspace(4)* %arrayidx.2, align 4
19  %add.2 = fadd float %tmp2, %add.1
20  %arrayidx.3 = getelementptr inbounds float, float addrspace(4)* %weights, i64 3
21  %tmp3 = load float, float addrspace(4)* %arrayidx.3, align 4
22  %add.3 = fadd float %tmp3, %add.2
23  %arrayidx.4 = getelementptr inbounds float, float addrspace(4)* %weights, i64 4
24  %tmp4 = load float, float addrspace(4)* %arrayidx.4, align 4
25  %add.4 = fadd float %tmp4, %add.3
26  %arrayidx.5 = getelementptr inbounds float, float addrspace(4)* %weights, i64 5
27  %tmp5 = load float, float addrspace(4)* %arrayidx.5, align 4
28  %add.5 = fadd float %tmp5, %add.4
29  %arrayidx.6 = getelementptr inbounds float, float addrspace(4)* %weights, i64 6
30  %tmp6 = load float, float addrspace(4)* %arrayidx.6, align 4
31  %add.6 = fadd float %tmp6, %add.5
32  %arrayidx.7 = getelementptr inbounds float, float addrspace(4)* %weights, i64 7
33  %tmp7 = load float, float addrspace(4)* %arrayidx.7, align 4
34  %add.7 = fadd float %tmp7, %add.6
35  store float %add.7, float addrspace(1)* %out_ptr, align 4
36  ret void
37}