2014-01-24 02:49:31 +08:00
|
|
|
; RUN: llc -march=r600 -mcpu=redwood %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
; This tests for a bug where vertex fetch clauses right before an ENDIF
|
|
|
|
; instruction where being emitted after the ENDIF. We were using ALU_POP_AFTER
|
|
|
|
; for the ALU clause before the vetex fetch instead of emitting a POP instruction
|
|
|
|
; after the fetch clause.
|
|
|
|
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; CHECK-LABEL: {{^}}test:
|
2014-01-24 02:49:31 +08:00
|
|
|
; CHECK-NOT: ALU_POP_AFTER
|
|
|
|
; CHECK: TEX
|
|
|
|
; CHECK-NEXT: POP
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i32 %cond) {
|
2014-01-24 02:49:31 +08:00
|
|
|
entry:
|
|
|
|
%0 = icmp eq i32 %cond, 0
|
|
|
|
br i1 %0, label %endif, label %if
|
|
|
|
|
|
|
|
if:
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32 addrspace(1)* %in
|
2014-01-24 02:49:31 +08:00
|
|
|
br label %endif
|
|
|
|
|
|
|
|
endif:
|
|
|
|
%x = phi i32 [ %1, %if], [ 0, %entry]
|
|
|
|
store i32 %x, i32 addrspace(1)* %out
|
|
|
|
br label %done
|
|
|
|
|
|
|
|
done:
|
|
|
|
ret void
|
|
|
|
}
|