summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/apint-and-compare.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/apint-and-compare.ll')
-rw-r--r--test/Transforms/InstCombine/apint-and-compare.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/apint-and-compare.ll b/test/Transforms/InstCombine/apint-and-compare.ll
new file mode 100644
index 000000000000..ad2e41d718ef
--- /dev/null
+++ b/test/Transforms/InstCombine/apint-and-compare.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 2
+
+; Should be optimized to one and.
+define i1 @test1(i33 %a, i33 %b) {
+ %tmp1 = and i33 %a, 65280
+ %tmp3 = and i33 %b, 65280
+ %tmp = icmp ne i33 %tmp1, %tmp3
+ ret i1 %tmp
+}
+
+define i1 @test2(i999 %a, i999 %b) {
+ %tmp1 = and i999 %a, 65280
+ %tmp3 = and i999 %b, 65280
+ %tmp = icmp ne i999 %tmp1, %tmp3
+ ret i1 %tmp
+}