summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-07-11 07:20:53 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-07-11 07:20:53 +0000
commit4bf1e59819b3830efb9025673e43e928395fafd0 (patch)
treec6409e83081d8ad1227f80b9a235efd7c82b7059 /test/Transforms/InstCombine
parent71ca353ae686ce9249eb333a48f12c1e4d47a319 (diff)
downloadllvm-4bf1e59819b3830efb9025673e43e928395fafd0.tar.gz
llvm-4bf1e59819b3830efb9025673e43e928395fafd0.tar.bz2
llvm-4bf1e59819b3830efb9025673e43e928395fafd0.tar.xz
Add another optimization from PR2330. Also catch some missing cases that are
similar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r--test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll
new file mode 100644
index 0000000000..50533db06d
--- /dev/null
+++ b/test/Transforms/InstCombine/2008-07-10-ICmpBinOp.ll
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep add
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep mul
+; PR2330
+
+define i1 @f(i32 %x, i32 %y) nounwind {
+entry:
+ %A = add i32 %x, 5
+ %B = add i32 %y, 5
+ %C = icmp eq i32 %A, %B
+ ret i1 %C
+}
+
+define i1 @g(i32 %x, i32 %y) nounwind {
+entry:
+ %A = mul i32 %x, 5
+ %B = mul i32 %y, 5
+ %C = icmp eq i32 %A, %B
+ ret i1 %C
+}