Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/MachineBlockPlacement.cpp
Show First 20 Lines • Show All 3,032 Lines • ▼ Show 20 Lines | bool EnableTailMerge = !MF.getTarget().requiresStructuredCFG() && | ||||
PassConfig->getEnableTailMerge() && | PassConfig->getEnableTailMerge() && | ||||
BranchFoldPlacement; | BranchFoldPlacement; | ||||
// No tail merging opportunities if the block number is less than four. | // No tail merging opportunities if the block number is less than four. | ||||
if (MF.size() > 3 && EnableTailMerge) { | if (MF.size() > 3 && EnableTailMerge) { | ||||
unsigned TailMergeSize = TailDupSize + 1; | unsigned TailMergeSize = TailDupSize + 1; | ||||
BranchFolder BF(/*EnableTailMerge=*/true, /*CommonHoist=*/false, *MBFI, | BranchFolder BF(/*EnableTailMerge=*/true, /*CommonHoist=*/false, *MBFI, | ||||
*MBPI, TailMergeSize); | *MBPI, TailMergeSize); | ||||
auto *MMIWP = getAnalysisIfAvailable<MachineModuleInfoWrapperPass>(); | |||||
if (BF.OptimizeFunction(MF, TII, MF.getSubtarget().getRegisterInfo(), | if (BF.OptimizeFunction(MF, TII, MF.getSubtarget().getRegisterInfo(), | ||||
getAnalysisIfAvailable<MachineModuleInfo>(), MLI, | MMIWP ? &MMIWP->getMMI() : nullptr, MLI, | ||||
/*AfterPlacement=*/true)) { | /*AfterPlacement=*/true)) { | ||||
// Redo the layout if tail merging creates/removes/moves blocks. | // Redo the layout if tail merging creates/removes/moves blocks. | ||||
BlockToChain.clear(); | BlockToChain.clear(); | ||||
arsenm: Another here | |||||
ComputedEdges.clear(); | ComputedEdges.clear(); | ||||
// Must redo the post-dominator tree if blocks were changed. | // Must redo the post-dominator tree if blocks were changed. | ||||
if (MPDT) | if (MPDT) | ||||
MPDT->runOnMachineFunction(MF); | MPDT->runOnMachineFunction(MF); | ||||
ChainAllocator.DestroyAll(); | ChainAllocator.DestroyAll(); | ||||
buildCFGChains(); | buildCFGChains(); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |
Another here