2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mattr=-promote-alloca -verify-machineinstrs < %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -mattr=-promote-alloca -verify-machineinstrs < %s
|
2014-10-10 03:06:00 +08:00
|
|
|
|
|
|
|
; Test that CopyToReg instructions don't have non-register operands prior
|
|
|
|
; to being emitted.
|
|
|
|
|
|
|
|
; Make sure this doesn't crash
|
|
|
|
; CHECK-LABEL: {{^}}copy_to_reg_frameindex:
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @copy_to_reg_frameindex(i32 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) {
|
2014-10-10 03:06:00 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
%alloca = alloca [16 x i32], addrspace(5)
|
2014-10-10 03:06:00 +08:00
|
|
|
br label %loop
|
|
|
|
|
|
|
|
loop:
|
|
|
|
%inc = phi i32 [0, %entry], [%inc.i, %loop]
|
2018-02-03 00:07:16 +08:00
|
|
|
%ptr = getelementptr [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 %inc
|
|
|
|
store i32 %inc, i32 addrspace(5)* %ptr
|
2014-10-10 03:06:00 +08:00
|
|
|
%inc.i = add i32 %inc, 1
|
|
|
|
%cnd = icmp uge i32 %inc.i, 16
|
|
|
|
br i1 %cnd, label %done, label %loop
|
|
|
|
|
|
|
|
done:
|
2018-02-03 00:07:16 +08:00
|
|
|
%tmp0 = getelementptr [16 x i32], [16 x i32] addrspace(5)* %alloca, i32 0, i32 0
|
|
|
|
%tmp1 = load i32, i32 addrspace(5)* %tmp0
|
2014-10-10 03:06:00 +08:00
|
|
|
store i32 %tmp1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|