1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs< %s | FileCheck %s 2 3 ; Test that codegenprepare understands address space sizes 4 5 %struct.foo = type { [3 x float], [3 x float] } 6 7 ; FIXME: Extra V_MOV from SGPR to VGPR for second read. The address is 8 ; already in a VGPR after the first read. 9 10 ; CHECK-LABEL: @do_as_ptr_calcs: 11 ; CHECK: S_LOAD_DWORD [[SREG1:s[0-9]+]], 12 ; CHECK: V_MOV_B32_e32 [[VREG1:v[0-9]+]], [[SREG1]] 13 ; CHECK: DS_READ_B32 v{{[0-9]+}}, [[VREG1]], 0x14 14 ; CHECK: DS_READ_B32 v{{[0-9]+}}, v{{[0-9]+}}, 0xc 15 define void @do_as_ptr_calcs(%struct.foo addrspace(3)* nocapture %ptr) nounwind { 16 entry: 17 %x = getelementptr inbounds %struct.foo addrspace(3)* %ptr, i32 0, i32 1, i32 0 18 %y = getelementptr inbounds %struct.foo addrspace(3)* %ptr, i32 0, i32 1, i32 2 19 br label %bb32 20 21 bb32: 22 %a = load float addrspace(3)* %x, align 4 23 %b = load float addrspace(3)* %y, align 4 24 %cmp = fcmp one float %a, %b 25 br i1 %cmp, label %bb34, label %bb33 26 27 bb33: 28 unreachable 29 30 bb34: 31 unreachable 32 } 33 34 35