Matt Arsenault | 37d42ec | 2013-09-06 00:18:43 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck %s |
| 2 | |
| 3 | ; Test that codegenprepare understands address space sizes |
| 4 | |
| 5 | %struct.foo = type { [3 x float], [3 x float] } |
| 6 | |
Matt Arsenault | 99ed789 | 2014-03-19 22:19:49 +0000 | [diff] [blame^] | 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 | |
Matt Arsenault | 37d42ec | 2013-09-06 00:18:43 +0000 | [diff] [blame] | 10 | ; CHECK-LABEL: @do_as_ptr_calcs: |
Matt Arsenault | 99ed789 | 2014-03-19 22:19:49 +0000 | [diff] [blame^] | 11 | ; CHECK: S_LOAD_DWORD [[SREG1:s[0-9]+]], |
Matt Arsenault | 43b8e4e | 2013-11-18 20:09:29 +0000 | [diff] [blame] | 12 | ; CHECK: V_MOV_B32_e32 [[VREG1:v[0-9]+]], [[SREG1]] |
Matt Arsenault | 99ed789 | 2014-03-19 22:19:49 +0000 | [diff] [blame^] | 13 | ; CHECK: DS_READ_B32 v{{[0-9]+}}, [[VREG1]], 20 |
| 14 | ; CHECK: DS_READ_B32 v{{[0-9]+}}, v{{[0-9]+}}, 12 |
Matt Arsenault | 37d42ec | 2013-09-06 00:18:43 +0000 | [diff] [blame] | 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 | |