diff options
author | Manman Ren <mren@apple.com> | 2012-07-18 21:40:01 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2012-07-18 21:40:01 +0000 |
commit | 62a89f5808bbb620767d95adb784978ed2e7bff0 (patch) | |
tree | 170f0bd3a274ea211c6ee4d6ee571eb114f3e68c /test | |
parent | d4d961615c67082bc24bfa5d372a93a1dcff3457 (diff) | |
download | external_llvm-62a89f5808bbb620767d95adb784978ed2e7bff0.zip external_llvm-62a89f5808bbb620767d95adb784978ed2e7bff0.tar.gz external_llvm-62a89f5808bbb620767d95adb784978ed2e7bff0.tar.bz2 |
X86: remove redundant cmp against zero.
Updated OptimizeCompare in peephole to remove redundant cmp against zero.
We only remove Compare if CF and OF are not used.
rdar://11855129
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/jump_sign.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/X86/jump_sign.ll b/test/CodeGen/X86/jump_sign.ll index 49f4176..5b7c19f 100644 --- a/test/CodeGen/X86/jump_sign.ll +++ b/test/CodeGen/X86/jump_sign.ll @@ -202,3 +202,14 @@ if.then.i103: ; preds = %if.then44 if.else.i104: ; preds = %if.then44 ret void } +; rdar://11855129 +define i32 @p(i32 %a, i32 %b) nounwind { +entry: +; CHECK: p: +; CHECK-NOT: test +; CHECK: cmovs + %add = add nsw i32 %b, %a + %cmp = icmp sgt i32 %add, 0 + %add. = select i1 %cmp, i32 %add, i32 0 + ret i32 %add. +} |