diff options
author | Duncan Sands <baldrick@free.fr> | 2011-01-13 08:56:29 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-01-13 08:56:29 +0000 |
commit | 6dc91253ab1872e118b08511a09d5c934988354e (patch) | |
tree | 810b5ba30e433923840e644ce3668854056c1187 /test/Transforms/InstSimplify | |
parent | 7597212abced110723f2fee985a7d60557c092ec (diff) | |
download | external_llvm-6dc91253ab1872e118b08511a09d5c934988354e.zip external_llvm-6dc91253ab1872e118b08511a09d5c934988354e.tar.gz external_llvm-6dc91253ab1872e118b08511a09d5c934988354e.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r-- | test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll b/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll index 8b795ea..3aa1bd6 100644 --- a/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll +++ b/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 +} |