summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/switch-bt.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-14 01:38:42 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-14 01:38:42 +0000
commit3ff25514ce24a521fc9524eefb257a1f5f262d84 (patch)
treebbf4d09b831d59ae312e5b8a3f42dda05b6414c1 /test/CodeGen/X86/switch-bt.ll
parentd77ec6208cef2a8e615181c2bf0fc5a50a37a20b (diff)
downloadllvm-3ff25514ce24a521fc9524eefb257a1f5f262d84.tar.gz
llvm-3ff25514ce24a521fc9524eefb257a1f5f262d84.tar.bz2
llvm-3ff25514ce24a521fc9524eefb257a1f5f262d84.tar.xz
Don't emit a bit test if there is only one case the test can yield false. A simple SETNE is sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/switch-bt.ll')
-rw-r--r--test/CodeGen/X86/switch-bt.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/switch-bt.ll b/test/CodeGen/X86/switch-bt.ll
index 9f491d452f..8e39342214 100644
--- a/test/CodeGen/X86/switch-bt.ll
+++ b/test/CodeGen/X86/switch-bt.ll
@@ -79,3 +79,23 @@ if.end: ; preds = %entry
}
declare void @bar()
+
+define void @test3(i32 %x) nounwind {
+; CHECK: test3:
+; CHECK: cmpl $5
+; CHECK: ja
+; CHECK: cmpl $4
+; CHECK: jne
+ switch i32 %x, label %if.end [
+ i32 0, label %if.then
+ i32 1, label %if.then
+ i32 2, label %if.then
+ i32 3, label %if.then
+ i32 5, label %if.then
+ ]
+if.then:
+ tail call void @bar() nounwind
+ ret void
+if.end:
+ ret void
+}