• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s | FileCheck %s
2
3target 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
17define amdgpu_kernel void @foo() {
18entry:
19  br label %loop
20
21loop:
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
28  br label %loop
29}
30
31