1 ; RUN: llc < %s | FileCheck %s
3 target triple = "amdgcn--"
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.
10 ; We shouldn't crash. Check that we get a loop with the two stores.
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]]
17 define amdgpu_kernel void @foo() {
22 %idx0 = phi i32 [ %next_idx0, %loop ], [ 0, %entry ]
23 %0 = getelementptr inbounds i32, i32 addrspace(5)* null, i32 %idx0
24 %1 = getelementptr inbounds i32, i32 addrspace(1)* null, i32 %idx0
25 store i32 1, i32 addrspace(5)* %0
26 store i32 7, i32 addrspace(1)* %1
27 %next_idx0 = add nuw nsw i32 %idx0, 1