summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-13 08:56:29 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-13 08:56:29 +0000
commit8d25a7c3a01639636bde0ff17f2d8962010cfd29 (patch)
tree352c915bffcf3b35ab2b45f00256e3f5fd2efccb /llvm/test
parent92adcac9ec01e0751db8d775b12ece52625b8804 (diff)
downloadbcm5719-llvm-8d25a7c3a01639636bde0ff17f2d8962010cfd29.tar.gz
bcm5719-llvm-8d25a7c3a01639636bde0ff17f2d8962010cfd29.zip
The most common simplification missed by instsimplify in unoptimized bitcode
is "X != 0 -> X" when X is a boolean. This occurs a lot because of the way llvm-gcc converts gcc's conditional expressions. Add this, and a few other similar transforms for completeness. llvm-svn: 123372
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll b/llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll
index 8b795eaaab6..3aa1bd60cfd 100644
--- a/llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll
+++ b/llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll
@@ -20,3 +20,10 @@ define i1 @mul(i1 %x) {
ret i1 %z
; CHECK: ret i1 %x
}
+
+define i1 @ne(i1 %x) {
+; CHECK: @ne
+ %z = icmp ne i1 %x, 0
+ ret i1 %z
+; CHECK: ret i1 %x
+}
OpenPOWER on IntegriCloud