[MachineBlockPlacement] Let the target optimize the branches at the end.
authorQuentin Colombet <qcolombet@apple.com>
Mon, 2 May 2016 22:58:59 +0000 (22:58 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 2 May 2016 22:58:59 +0000 (22:58 +0000)
commit776e6de51626b01b6e4d062c243e48bcc9446884
treeee315b33525a5506702831b78fd6e1c2572561bd
parent4e1d389ac5cf5048d2c4e90caa2de672d7445148
[MachineBlockPlacement] Let the target optimize the branches at the end.

After the layout of the basic blocks is set, the target may be able to get rid
of unconditional branches to fallthrough blocks that the generic code does not
catch. This happens any time TargetInstrInfo::AnalyzeBranch is not able to
analyze all the branches involved in the terminators sequence, while still
understanding a few of them.

In such situation, AnalyzeBranch can directly modify the branches if it has been
instructed to do so.

This patch takes advantage of that.

llvm-svn: 268328
llvm/lib/CodeGen/MachineBlockPlacement.cpp
llvm/test/CodeGen/X86/implicit-null-check.ll