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 | 8d25a7c3a01639636bde0ff17f2d8962010cfd29 (patch) | |
| tree | 352c915bffcf3b35ab2b45f00256e3f5fd2efccb /llvm/test/Transforms/InstSimplify | |
| parent | 92adcac9ec01e0751db8d775b12ece52625b8804 (diff) | |
| download | bcm5719-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/Transforms/InstSimplify')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/2010-12-20-I1Arithmetic.ll | 7 | 
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 +} | 

