1 ; RUN: llc -march=amdgcn -mattr=-promote-alloca -verify-machineinstrs < %s
2 ; RUN: llc -march=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(i32 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], [16 x i32] addrspace(5)* %alloca, i32 0, i32 %inc
17 store i32 %inc, i32 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 %tmp0 = getelementptr [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 0
24 %tmp1 = load i32, i32 addrspace(5)* %tmp0
25 store i32 %tmp1, i32 addrspace(1)* %out