diff options
Diffstat (limited to 'llvm/test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index c8f7f81468f..77ca62cfec6 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/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 +} |