The logic for breaking the CFG in the presence of hot successors didn't
authorChandler Carruth <chandlerc@gmail.com>
Sun, 20 Nov 2011 11:22:06 +0000 (11:22 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 20 Nov 2011 11:22:06 +0000 (11:22 +0000)
commitb0dadb9dd52aed7a82e24542be8adf881d91c929
tree7defe5f020aa6b712f470af483b765183b2da9f7
parenta91a3e04895f2049f7607cfe6fd1aa7b276ed3da
The logic for breaking the CFG in the presence of hot successors didn't
properly account for the *global* probability of the edge being taken.
This manifested as a very large number of unconditional branches to
blocks being merged against the CFG even though they weren't
particularly hot within the CFG.

The fix is to check whether the edge being merged is both locally hot
relative to other successors for the source block, and globally hot
compared to other (unmerged) predecessors of the destination block.

This introduces a new crasher on GCC single-source, but it's currently
behind a flag, and Ben has offered to work on the reduction. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145010 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/X86/block-placement.ll