1 ; RUN: llc -mtriple=amdgcn -mattr=-promote-alloca -verify-machineinstrs < %s
2 ; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -mattr=-promote-alloca -verify-machineinstrs < %s
4 ; Test that CopyToReg instructions don't have non-register operands prior
7 ; Make sure this doesn't crash
8 ; CHECK-LABEL: {{^}}copy_to_reg_frameindex:
9 define amdgpu_kernel void @copy_to_reg_frameindex(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c) {
11 %alloca = alloca [16 x i32], addrspace(5)
15 %inc = phi i32 [0, %entry], [%inc.i, %loop]
16 %ptr = getelementptr [16 x i32], ptr addrspace(5) %alloca, i32 0, i32 %inc
17 store i32 %inc, ptr addrspace(5) %ptr
18 %inc.i = add i32 %inc, 1
19 %cnd = icmp uge i32 %inc.i, 16
20 br i1 %cnd, label %done, label %loop
23 %tmp1 = load i32, ptr addrspace(5) %alloca
24 store i32 %tmp1, ptr addrspace(1) %out