Skip to content

Commit 5f024a0

Browse files
committed
[CodeLayout] Do not rebuild chains when opt for size
1 parent a93cbd4 commit 5f024a0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/lib/CodeGen/MachineBlockPlacement.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,14 +3558,16 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
35583558

35593559
if (BF.OptimizeFunction(MF, TII, MF.getSubtarget().getRegisterInfo(), MLI,
35603560
/*AfterPlacement=*/true)) {
3561-
// Redo the layout if tail merging creates/removes/moves blocks.
3562-
BlockToChain.clear();
3563-
ComputedEdges.clear();
35643561
// Must redo the post-dominator tree if blocks were changed.
35653562
if (MPDT)
35663563
MPDT->recalculate(MF);
3567-
ChainAllocator.DestroyAll();
3568-
buildCFGChains();
3564+
if (!UseExtTspForSize) {
3565+
// Redo the layout if tail merging creates/removes/moves blocks.
3566+
BlockToChain.clear();
3567+
ComputedEdges.clear();
3568+
ChainAllocator.DestroyAll();
3569+
buildCFGChains();
3570+
}
35693571
}
35703572
}
35713573

0 commit comments

Comments
 (0)