summaryrefslogtreecommitdiff
path: root/lib/Target/README.txt
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 /lib/Target/README.txt
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 'lib/Target/README.txt')
-rw-r--r--lib/Target/README.txt13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index 4e382e8f8e..4cc9534089 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -1762,7 +1762,6 @@ case it choses instead to keep the max operation obvious.
//===---------------------------------------------------------------------===//
-Switch lowering generates less than ideal code for the following switch:
define void @a(i32 %x) nounwind {
entry:
switch i32 %x, label %if.end [
@@ -1783,19 +1782,15 @@ declare void @foo()
Generated code on x86-64 (other platforms give similar results):
a:
cmpl $5, %edi
- ja .LBB0_2
- movl %edi, %eax
- movl $47, %ecx
- btq %rax, %rcx
- jb .LBB0_3
+ ja LBB2_2
+ cmpl $4, %edi
+ jne LBB2_3
.LBB0_2:
ret
.LBB0_3:
jmp foo # TAILCALL
-The movl+movl+btq+jb could be simplified to a cmpl+jne.
-
-Or, if we wanted to be really clever, we could simplify the whole thing to
+If we wanted to be really clever, we could simplify the whole thing to
something like the following, which eliminates a branch:
xorl $1, %edi
cmpl $4, %edi