[PATCH] SelectionDAG switch lowering: Replace unreachable default with most popular case.

Hans Wennborg hans at chromium.org
Wed Dec 3 11:22:56 PST 2014


Hi majnemer,

This can significantly reduce the size of the switch, allowing for more
efficient lowering.

SimplifyCFG currently does this transformation, but I'm working on
changing that to make it possible to exploit unreachable default cases.
    
I also worked with the idea of exploiting unreachable defaults by
omitting the range check for jump tables, but always ended up with a
non-neglible binary size increase. It might be worth looking into some more.

(This was broken out of http://reviews.llvm.org/D6471)

http://reviews.llvm.org/D6510

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  test/CodeGen/X86/2013-10-14-FastISel-incorrect-vreg.ll
  test/CodeGen/X86/asm-label.ll
  test/CodeGen/X86/switch-jump-table.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6510.16875.patch
Type: text/x-patch
Size: 5514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141203/e8fcb099/attachment.bin>


More information about the llvm-commits mailing list