| ; RUN: llc -mtriple=r600 -mcpu=redwood -r600-if-convert=0 < %s | FileCheck %s |
| ; This tests for abug where the AMDILCFGStructurizer was crashing on loops |
| ; for (i = 0; i < x; i++) { |
| ; CHECK-LABEL: {{^}}if_inside_loop: |
| define amdgpu_kernel void @if_inside_loop(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c, i32 %d) { |
| %0 = phi i32 [0, %entry], [%inc, %for.inc] |
| %val = phi i32 [0, %entry], [%val.for.inc, %for.inc] |
| br i1 %1, label %for.inc, label %if.then |
| br i1 %2, label %if.then.true, label %if.then.false |
| %val.if = phi i32 [%3, %if.then.true], [%4, %if.then.false] |
| br i1 %5, label %if.true, label %for.inc |
| %val.for.inc = phi i32 [%val, %for.body], [%val.if, %if], [%6, %if.true] |
| br i1 %7, label %for.body, label %exit |
| store i32 %val.for.inc, ptr addrspace(1) %out |