Home | History | Annotate | Download | only in AMDGPU
      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_read2_b32 v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} offset0:2 offset1:3
     12 ; SI: ds_read2_b32 v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} offset0:14 offset1:12
     13 ; SI: ds_read_b32 v{{[0-9]+}}, v{{[0-9]+}} offset:44
     14 
     15 define void @offset_order(float addrspace(1)* %out) {
     16 entry:
     17   %ptr0 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 0
     18   %val0 = load float, float addrspace(3)* %ptr0
     19 
     20   %ptr1 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 256
     21   %val1 = load float, float addrspace(3)* %ptr1
     22   %add1 = fadd float %val0, %val1
     23 
     24   %ptr2 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 3
     25   %val2 = load float, float addrspace(3)* %ptr2
     26   %add2 = fadd float %add1, %val2
     27 
     28   %ptr3 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 2
     29   %val3 = load float, float addrspace(3)* %ptr3
     30   %add3 = fadd float %add2, %val3
     31 
     32   %ptr4 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 12
     33   %val4 = load float, float addrspace(3)* %ptr4
     34   %add4 = fadd float %add3, %val4
     35 
     36   %ptr5 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 14
     37   %val5 = load float, float addrspace(3)* %ptr5
     38   %add5 = fadd float %add4, %val5
     39 
     40   %ptr6 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 11
     41   %val6 = load float, float addrspace(3)* %ptr6
     42   %add6 = fadd float %add5, %val6
     43   store float %add6, float addrspace(1)* %out
     44   ret void
     45 }
     46