Switch lowering: Take branch weight into account when ordering for fall-through
authorHans Wennborg <hans@hanshq.net>
Mon, 27 Apr 2015 23:35:22 +0000 (23:35 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 27 Apr 2015 23:35:22 +0000 (23:35 +0000)
commitb176a4f2e41751bb52bd791979749c16d22bef18
tree46746c8b8e9104855ae18589fc165c6e497932fd
parentae51ba7ea122ba10d8ee93a282fff7f7c47bca76
Switch lowering: Take branch weight into account when ordering for fall-through

Previously, the code would try to put a fall-through case last,
even if that meant moving a case with much higher branch weight
further down the chain.

Ordering by branch weight is most important, putting a fall-through
block last is secondary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235942 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/ARM/arm-and-tst-peephole.ll
test/CodeGen/Generic/MachineBranchProb.ll
test/CodeGen/X86/ragreedy-hoist-spill.ll
test/CodeGen/X86/switch.ll