Mikael Holmen | ece84cd | 2017-02-14 06:37:42 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | |
Mikael Holmen | ece84cd | 2017-02-14 06:37:42 +0000 | [diff] [blame] | 3 | target triple = "amdgcn--" |
| 4 | |
| 5 | ; We need to compile this for a target where we have different address spaces, |
| 6 | ; and where pointers in those address spaces have different size. |
| 7 | ; E.g. for amdgcn-- pointers in address space 0 are 32 bits and pointers in |
| 8 | ; address space 1 are 64 bits. |
| 9 | |
| 10 | ; We shouldn't crash. Check that we get a loop with the two stores. |
| 11 | ;CHECK-LABEL: foo: |
| 12 | ;CHECK: [[LOOP_LABEL:BB[0-9]+_[0-9]+]]: |
| 13 | ;CHECK: buffer_store_dword |
| 14 | ;CHECK: buffer_store_dword |
| 15 | ;CHECK: s_branch [[LOOP_LABEL]] |
| 16 | |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 17 | define amdgpu_kernel void @foo() { |
Mikael Holmen | ece84cd | 2017-02-14 06:37:42 +0000 | [diff] [blame] | 18 | entry: |
| 19 | br label %loop |
| 20 | |
| 21 | loop: |
| 22 | %idx0 = phi i32 [ %next_idx0, %loop ], [ 0, %entry ] |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 23 | %0 = getelementptr inbounds i32, i32 addrspace(5)* null, i32 %idx0 |
Mikael Holmen | ece84cd | 2017-02-14 06:37:42 +0000 | [diff] [blame] | 24 | %1 = getelementptr inbounds i32, i32 addrspace(1)* null, i32 %idx0 |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 25 | store i32 1, i32 addrspace(5)* %0 |
Mikael Holmen | ece84cd | 2017-02-14 06:37:42 +0000 | [diff] [blame] | 26 | store i32 7, i32 addrspace(1)* %1 |
| 27 | %next_idx0 = add nuw nsw i32 %idx0, 1 |
| 28 | br label %loop |
| 29 | } |
| 30 | |