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)
commit67c03759e4f788d61c4475094295d42f7b8a2a15
treeff18d945c442ab8620b63da68d3fdde4402b8b25
parent753e007091a7e70029750e68bcd5b82ab886830a
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.

llvm-svn: 235942
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/ARM/arm-and-tst-peephole.ll
llvm/test/CodeGen/Generic/MachineBranchProb.ll
llvm/test/CodeGen/X86/ragreedy-hoist-spill.ll
llvm/test/CodeGen/X86/switch.ll