SelectionDAG switch lowering: Replace unreachable default with most popular case.
authorHans Wennborg <hans@hanshq.net>
Mon, 1 Dec 2014 17:08:32 +0000 (17:08 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 1 Dec 2014 17:08:32 +0000 (17:08 +0000)
commite6f4d335d72a0af4f907d565eaade62e34d77fd3
tree617727f7d9f199ff388f06b02f3a468f9c34588d
parentd9788e9372793481a887ba21c0c773990364d611
SelectionDAG switch lowering: Replace unreachable default with most popular case.

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

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223049 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]