diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-04 20:16:36 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-04 20:16:36 +0000 |
commit | fc87cdc1f4df357167a7cef91af92b5012934124 (patch) | |
tree | 202492e0fb2166571cb63de740d776f33a2e63a3 /test | |
parent | cbb11869c47bdf8f3fa540dc0ee44075c0da8598 (diff) | |
download | external_llvm-fc87cdc1f4df357167a7cef91af92b5012934124.zip external_llvm-fc87cdc1f4df357167a7cef91af92b5012934124.tar.gz external_llvm-fc87cdc1f4df357167a7cef91af92b5012934124.tar.bz2 |
PR10267: Don't combine an equality compare with an AND into an inequality compare when the AND has more than one use.
This can pessimize code, inequalities are generally more expensive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index c8f7f81..77ca62c 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -547,3 +547,15 @@ define i1 @test56(i32 %a) { %cmp = icmp eq i32 %sub, 123 ret i1 %cmp } + +; PR10267 Don't make icmps more expensive when no other inst is subsumed. +declare void @foo(i32) +; CHECK: @test57 +; CHECK: %and = and i32 %a, -2 +; CHECK: %cmp = icmp ne i32 %and, 0 +define i1 @test57(i32 %a) { + %and = and i32 %a, -2 + %cmp = icmp ne i32 %and, 0 + call void @foo(i32 %and) + ret i1 %cmp +} |