summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-01-01 01:18:23 +0000
committerBill Wendling <isanbard@gmail.com>2009-01-01 01:18:23 +0000
commitaedb54a947bbeef92ebbe501ba0db8ba120f3a00 (patch)
tree753ef30f54aee2aad4cef90ed7571897292eca90 /llvm/test
parent4f8b265825c592ef885157f0832ac6ad5aa72fd6 (diff)
downloadbcm5719-llvm-aedb54a947bbeef92ebbe501ba0db8ba120f3a00.tar.gz
bcm5719-llvm-aedb54a947bbeef92ebbe501ba0db8ba120f3a00.zip
Add transformation:
xor (or (icmp, icmp), true) -> and(icmp, icmp) This is possible because of De Morgan's law. llvm-svn: 61537
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/xor-demorgans.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/xor-demorgans.ll b/llvm/test/Transforms/InstCombine/xor-demorgans.ll
new file mode 100644
index 00000000000..763794befcb
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/xor-demorgans.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {= or}
+; PR3266
+
+define i1 @foo(i32 %x, i32 %y) nounwind {
+.summary:
+ %0 = icmp sgt i32 %x, 4 ; <i1> [#uses=1]
+ %1 = icmp sgt i32 %y, 0 ; <i1> [#uses=1]
+ %.demorgan = or i1 %1, %0 ; <i1> [#uses=1]
+ %2 = xor i1 %.demorgan, true ; <i1> [#uses=1]
+ ret i1 %2
+}
OpenPOWER on IntegriCloud