summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-05-08 06:44:42 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-05-08 06:44:42 +0000
commit363160a6be82df343fa60aa09d9d8f8f44605529 (patch)
tree8385f9313f583f6f7f9bcf1d53a42ebe4475e14a /test/CodeGen/X86
parentaa76a93cd35abd922b66825bb4e3e0b6e14ccfd5 (diff)
downloadllvm-363160a6be82df343fa60aa09d9d8f8f44605529.tar.gz
llvm-363160a6be82df343fa60aa09d9d8f8f44605529.tar.bz2
llvm-363160a6be82df343fa60aa09d9d8f8f44605529.tar.xz
DAGCombiner: Simplify inverted bit tests
Fold (xor (and x, y), y) -> (and (not x), y) This removes an opportunity for a constant to appear twice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/xor.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/X86/xor.ll b/test/CodeGen/X86/xor.ll
index 996bfc40ee..2408bfe72c 100644
--- a/test/CodeGen/X86/xor.ll
+++ b/test/CodeGen/X86/xor.ll
@@ -142,3 +142,15 @@ entry:
; X32: test8:
; X32: notl %eax
}
+
+define i32 @test9(i32 %a) nounwind {
+ %1 = and i32 %a, 4096
+ %2 = xor i32 %1, 4096
+ ret i32 %2
+; X64: test9:
+; X64: notl [[REG:%[a-z]+]]
+; X64: andl {{.*}}[[REG:%[a-z]+]]
+; X32: test9:
+; X32: notl [[REG:%[a-z]+]]
+; X32: andl {{.*}}[[REG:%[a-z]+]]
+}