summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/switch-bt.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-01-06 01:02:44 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-01-06 01:02:44 +0000
commitd08e5b48bc5d9177b1d70a1980a7805420a99085 (patch)
treeeba84180bd1bb0bc4918cdce0b29604e8f4b8d9e /test/CodeGen/X86/switch-bt.ll
parenta99ec28134c2fd0a21c446a58bf6406b8aa1a580 (diff)
downloadllvm-d08e5b48bc5d9177b1d70a1980a7805420a99085.tar.gz
llvm-d08e5b48bc5d9177b1d70a1980a7805420a99085.tar.bz2
llvm-d08e5b48bc5d9177b1d70a1980a7805420a99085.tar.xz
Avoid zero extend bit test operands to pointer type if all the masks fit in
the original type of the switch statement key. rdar://8781238 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/switch-bt.ll')
-rw-r--r--test/CodeGen/X86/switch-bt.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/X86/switch-bt.ll b/test/CodeGen/X86/switch-bt.ll
index ed3266ec42..9f491d452f 100644
--- a/test/CodeGen/X86/switch-bt.ll
+++ b/test/CodeGen/X86/switch-bt.ll
@@ -49,3 +49,33 @@ sw.epilog: ; preds = %sw.default, %sw.bb4
}
declare void @foo(i32)
+
+; Don't zero extend the test operands to pointer type if it can be avoided.
+; rdar://8781238
+define void @test2(i32 %x) nounwind ssp {
+; CHECK: test2:
+; CHECK: cmpl $6
+; CHECK: ja
+
+; CHECK-NEXT: movl $91
+; CHECK-NOT: movl
+; CHECK-NEXT: btl
+; CHECK-NEXT: jb
+entry:
+ switch i32 %x, label %if.end [
+ i32 6, label %if.then
+ i32 4, label %if.then
+ i32 3, label %if.then
+ i32 1, label %if.then
+ i32 0, label %if.then
+ ]
+
+if.then: ; preds = %entry, %entry, %entry, %entry, %entry
+ tail call void @bar() nounwind
+ ret void
+
+if.end: ; preds = %entry
+ ret void
+}
+
+declare void @bar()