summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/R600/xor.ll
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-06-20 17:05:57 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-06-20 17:05:57 +0000
commitc9dedb8e2974e120624ed6536e4c69f6c4b1ef0d (patch)
tree99c08f683db027ca36f7a2741bff6dbc23bc4c2f /llvm/test/CodeGen/R600/xor.ll
parentffa73bd44c44d17e0a33297c98c8c4d1f319cf0a (diff)
downloadbcm5719-llvm-c9dedb8e2974e120624ed6536e4c69f6c4b1ef0d.tar.gz
bcm5719-llvm-c9dedb8e2974e120624ed6536e4c69f6c4b1ef0d.zip
R600/SI: Add a VALU pattern for i64 xor
llvm-svn: 211373
Diffstat (limited to 'llvm/test/CodeGen/R600/xor.ll')
-rw-r--r--llvm/test/CodeGen/R600/xor.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/xor.ll b/llvm/test/CodeGen/R600/xor.ll
index 00430417399..ab618cf40c3 100644
--- a/llvm/test/CodeGen/R600/xor.ll
+++ b/llvm/test/CodeGen/R600/xor.ll
@@ -130,3 +130,29 @@ define void @vector_not_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %in0, i64
store i64 %result, i64 addrspace(1)* %out
ret void
}
+
+; Test that we have a pattern to match xor inside a branch.
+; Note that in the future the backend may be smart enough to
+; use an SALU instruction for this.
+
+; SI-CHECK-LABEL: @xor_cf
+; SI-CHECK: V_XOR
+; SI-CHECK: V_XOR
+define void @xor_cf(i64 addrspace(1)* %out, i64 addrspace(1)* %in, i64 %a, i64 %b) {
+entry:
+ %0 = icmp eq i64 %a, 0
+ br i1 %0, label %if, label %else
+
+if:
+ %1 = xor i64 %a, %b
+ br label %endif
+
+else:
+ %2 = load i64 addrspace(1)* %in
+ br label %endif
+
+endif:
+ %3 = phi i64 [%1, %if], [%2, %else]
+ store i64 %3, i64 addrspace(1)* %out
+ ret void
+}
OpenPOWER on IntegriCloud