source: icGREP/icgrep-devel/llvm-3.8.0.src/test/CodeGen/AMDGPU/ds_read2_offset_order.ll @ 5027

Last change on this file since 5027 was 5027, checked in by cameron, 3 years ago

Upgrade to llvm 3.8

File size: 2.0 KB
Line 
1; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs -mattr=+load-store-opt < %s | FileCheck -strict-whitespace -check-prefix=SI %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs -mattr=+load-store-opt < %s | FileCheck -strict-whitespace -check-prefix=SI %s
3
4
5@lds = addrspace(3) global [512 x float] undef, align 4
6
7; offset0 is larger than offset1
8
9; SI-LABEL: {{^}}offset_order:
10
11; SI: ds_read2st64_b32 v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} offset1:4{{$}}
12; SI: ds_read2_b32 v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} offset0:3 offset1:2
13; SI: ds_read2_b32 v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} offset0:12 offset1:14
14; SI: ds_read_b32 v{{[0-9]+}}, v{{[0-9]+}} offset:44
15
16define void @offset_order(float addrspace(1)* %out) {
17entry:
18  %ptr0 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 0
19  %val0 = load float, float addrspace(3)* %ptr0
20
21  %ptr1 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 256
22  %val1 = load float, float addrspace(3)* %ptr1
23  %add1 = fadd float %val0, %val1
24
25  %ptr2 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 3
26  %val2 = load float, float addrspace(3)* %ptr2
27  %add2 = fadd float %add1, %val2
28
29  %ptr3 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 2
30  %val3 = load float, float addrspace(3)* %ptr3
31  %add3 = fadd float %add2, %val3
32
33  %ptr4 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 12
34  %val4 = load float, float addrspace(3)* %ptr4
35  %add4 = fadd float %add3, %val4
36
37  %ptr5 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 14
38  %val5 = load float, float addrspace(3)* %ptr5
39  %add5 = fadd float %add4, %val5
40
41  %ptr6 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 11
42  %val6 = load float, float addrspace(3)* %ptr6
43  %add6 = fadd float %add5, %val6
44  store float %add6, float addrspace(1)* %out
45  ret void
46}
Note: See TracBrowser for help on using the repository browser.