summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/sub.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-09 05:19:28 +0000
committerChris Lattner <sabre@nondot.org>2008-05-09 05:19:28 +0000
commitaaba10e8435b26d71b27a03b4e2efeb86c153891 (patch)
tree7077de93e013b1de74fba9cb952b20a750b77d18 /llvm/test/Transforms/InstCombine/sub.ll
parente7f0afe1680166832cdafdcabd001ac7864e81ba (diff)
downloadbcm5719-llvm-aaba10e8435b26d71b27a03b4e2efeb86c153891.tar.gz
bcm5719-llvm-aaba10e8435b26d71b27a03b4e2efeb86c153891.zip
Implement PR2298. This transforms:
~x < ~y --> y < x -x == -y --> x == y llvm-svn: 50882
Diffstat (limited to 'llvm/test/Transforms/InstCombine/sub.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/sub.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll
index 9ee8b068450..da6d710f6bc 100644
--- a/llvm/test/Transforms/InstCombine/sub.ll
+++ b/llvm/test/Transforms/InstCombine/sub.ll
@@ -134,3 +134,13 @@ define i1 @test21(i32 %g, i32 %h) {
%tmp.4 = icmp ne i32 %tmp.2, %g ; <i1> [#uses=1]
ret i1 %tmp.4
}
+
+; PR2298
+define i8 @test22(i32 %a, i32 %b) zeroext nounwind {
+ %tmp2 = sub i32 0, %a ; <i32> [#uses=1]
+ %tmp4 = sub i32 0, %b ; <i32> [#uses=1]
+ %tmp5 = icmp eq i32 %tmp2, %tmp4 ; <i1> [#uses=1]
+ %retval89 = zext i1 %tmp5 to i8 ; <i8> [#uses=1]
+ ret i8 %retval89
+}
+
OpenPOWER on IntegriCloud