[llvm-branch-commits] [llvm-branch] r204639 - Merging r199917:

Tom Stellard thomas.stellard at amd.com
Mon Mar 24 11:21:27 PDT 2014


Author: tstellar
Date: Mon Mar 24 13:21:27 2014
New Revision: 204639

URL: http://llvm.org/viewvc/llvm-project?rev=204639&view=rev
Log:
Merging r199917:

------------------------------------------------------------------------
r199917 | thomas.stellard | 2014-01-23 10:49:31 -0800 (Thu, 23 Jan 2014) | 6 lines

R600: Correctly handle vertex fetch clauses the precede ENDIFs

The control flow finalizer would sometimes use an ALU_POP_AFTER
instruction before the vetex fetch clause instead of using a POP
instruction after it.

Added:
    llvm/branches/release_34/test/CodeGen/R600/vtx-fetch-branch.ll
Modified:
    llvm/branches/release_34/lib/Target/R600/R600ControlFlowFinalizer.cpp

Modified: llvm/branches/release_34/lib/Target/R600/R600ControlFlowFinalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/lib/Target/R600/R600ControlFlowFinalizer.cpp?rev=204639&r1=204638&r2=204639&view=diff
==============================================================================
--- llvm/branches/release_34/lib/Target/R600/R600ControlFlowFinalizer.cpp (original)
+++ llvm/branches/release_34/lib/Target/R600/R600ControlFlowFinalizer.cpp Mon Mar 24 13:21:27 2014
@@ -356,6 +356,7 @@ public:
           DEBUG(dbgs() << CfCount << ":"; I->dump(););
           FetchClauses.push_back(MakeFetchClause(MBB, I));
           CfCount++;
+          LastAlu.back() = 0;
           continue;
         }
 

Added: llvm/branches/release_34/test/CodeGen/R600/vtx-fetch-branch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_34/test/CodeGen/R600/vtx-fetch-branch.ll?rev=204639&view=auto
==============================================================================
--- llvm/branches/release_34/test/CodeGen/R600/vtx-fetch-branch.ll (added)
+++ llvm/branches/release_34/test/CodeGen/R600/vtx-fetch-branch.ll Mon Mar 24 13:21:27 2014
@@ -0,0 +1,29 @@
+; 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.
+
+
+; CHECK-LABEL: @test
+; CHECK-NOT: ALU_POP_AFTER
+; CHECK: TEX
+; CHECK-NEXT: POP
+define void @test(i32 addrspace(1)* %out, i32 addrspace(1)* %in, i32 %cond) {
+entry:
+  %0 = icmp eq i32 %cond, 0
+  br i1 %0, label %endif, label %if
+
+if:
+  %1 = load i32 addrspace(1)* %in
+  br label %endif
+
+endif:
+  %x = phi i32 [ %1, %if], [ 0, %entry]
+  store i32 %x, i32 addrspace(1)* %out
+  br label %done
+
+done:
+  ret void
+}





More information about the llvm-branch-commits mailing list