Tom Stellard | 49f8bfd | 2015-01-06 18:00:21 +0000 | [diff] [blame^] | 1 | ; RUN: llc -march=amdgcn -mcpu=SI -mattr=-promote-alloca -verify-machineinstrs < %s |
Tom Stellard | 3457a84 | 2014-10-09 19:06:00 +0000 | [diff] [blame] | 2 | |
| 3 | ; Test that CopyToReg instructions don't have non-register operands prior |
| 4 | ; to being emitted. |
| 5 | |
| 6 | ; Make sure this doesn't crash |
| 7 | ; CHECK-LABEL: {{^}}copy_to_reg_frameindex: |
| 8 | define void @copy_to_reg_frameindex(i32 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) { |
| 9 | entry: |
| 10 | %alloca = alloca [16 x i32] |
| 11 | br label %loop |
| 12 | |
| 13 | loop: |
| 14 | %inc = phi i32 [0, %entry], [%inc.i, %loop] |
| 15 | %ptr = getelementptr [16 x i32]* %alloca, i32 0, i32 %inc |
| 16 | store i32 %inc, i32* %ptr |
| 17 | %inc.i = add i32 %inc, 1 |
| 18 | %cnd = icmp uge i32 %inc.i, 16 |
| 19 | br i1 %cnd, label %done, label %loop |
| 20 | |
| 21 | done: |
| 22 | %tmp0 = getelementptr [16 x i32]* %alloca, i32 0, i32 0 |
| 23 | %tmp1 = load i32* %tmp0 |
| 24 | store i32 %tmp1, i32 addrspace(1)* %out |
| 25 | ret void |
| 26 | } |