Minor amendment to switch-lowering improvement.
authorEli Friedman <eli.friedman@gmail.com>
Sat, 3 Jul 2010 08:43:32 +0000 (08:43 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sat, 3 Jul 2010 08:43:32 +0000 (08:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107569 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/README.txt

index 8f785393fd04e388591b355c6727445358306115..90afe3640ce7d961332861fdaff55de1e4c7639b 100644 (file)
@@ -1918,9 +1918,17 @@ a:
 .LBB0_2:
        ret
 .LBB0_3:
-       xorb    %al, %al
-       jmp     foo@PLT  # TAILCALL
+       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
+something like the following, which eliminates a branch:
+       xorl    $1, %edi
+       cmpl    $4, %edi
+       ja      .LBB0_2
+       ret
+.LBB0_2:
+       jmp     foo  # TAILCALL
+
 //===---------------------------------------------------------------------===//