[llvm] r217041 - R600/SI: Add a pattern for i64 and in a branch

Tom Stellard thomas.stellard at amd.com
Wed Sep 3 08:22:41 PDT 2014


Author: tstellar
Date: Wed Sep  3 10:22:41 2014
New Revision: 217041

URL: http://llvm.org/viewvc/llvm-project?rev=217041&view=rev
Log:
R600/SI: Add a pattern for i64 and in a branch

Modified:
    llvm/trunk/lib/Target/R600/SIInstructions.td
    llvm/trunk/test/CodeGen/R600/and.ll

Modified: llvm/trunk/lib/Target/R600/SIInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIInstructions.td?rev=217041&r1=217040&r2=217041&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIInstructions.td (original)
+++ llvm/trunk/lib/Target/R600/SIInstructions.td Wed Sep  3 10:22:41 2014
@@ -1897,6 +1897,7 @@ class BinOp64Pat <SDNode node, Instructi
                   (EXTRACT_SUBREG i64:$src1, sub1)), sub1)
 >;
 
+def : BinOp64Pat <and, V_AND_B32_e32>;
 def : BinOp64Pat <or, V_OR_B32_e32>;
 def : BinOp64Pat <xor, V_XOR_B32_e32>;
 

Modified: llvm/trunk/test/CodeGen/R600/and.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/R600/and.ll?rev=217041&r1=217040&r2=217041&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/R600/and.ll (original)
+++ llvm/trunk/test/CodeGen/R600/and.ll Wed Sep  3 10:22:41 2014
@@ -108,6 +108,26 @@ define void @v_and_i64(i64 addrspace(1)*
   ret void
 }
 
+; FUNC-LABEL: @v_and_i64_br
+; SI: V_AND_B32
+; SI: V_AND_B32
+define void @v_and_i64_br(i64 addrspace(1)* %out, i64 addrspace(1)* %aptr, i64 addrspace(1)* %bptr, i32 %cond) {
+entry:
+  %tmp0 = icmp eq i32 %cond, 0
+  br i1 %tmp0, label %if, label %endif
+
+if:
+  %a = load i64 addrspace(1)* %aptr, align 8
+  %b = load i64 addrspace(1)* %bptr, align 8
+  %and = and i64 %a, %b
+  br label %endif
+
+endif:
+  %tmp1 = phi i64 [%and, %if], [0, %entry]
+  store i64 %tmp1, i64 addrspace(1)* %out, align 8
+  ret void
+}
+
 ; FUNC-LABEL: @v_and_constant_i64
 ; SI: V_AND_B32
 ; SI: V_AND_B32





More information about the llvm-commits mailing list