void rotateLoopWithProfile(BlockChain &LoopChain, MachineLoop &L,
const BlockFilterSet &LoopBlockSet);
void buildCFGChains(MachineFunction &F);
+ void alignBlocks(MachineFunction &F);
public:
static char ID; // Pass identification, replacement for typeid
MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch.
if (!TII->AnalyzeBranch(F.back(), TBB, FBB, Cond))
F.back().updateTerminator();
+}
+void MachineBlockPlacement::alignBlocks(MachineFunction &F) {
// Walk through the backedges of the function now that we have fully laid out
// the basic blocks and align the destination of each backedge. We don't rely
// exclusively on the loop info here so that we can align backedges in
// FIXME: Use Function::optForSize().
if (F.getFunction()->hasFnAttribute(Attribute::OptimizeForSize))
return;
+ BlockChain &FunctionChain = *BlockToChain[&F.front()];
if (FunctionChain.begin() == FunctionChain.end())
return; // Empty chain.
assert(BlockToChain.empty());
buildCFGChains(F);
+ alignBlocks(F);
BlockToChain.clear();
ChainAllocator.DestroyAll();