From bcdc0477319a26fd8dcdde5ace3bdd6743599f44 Mon Sep 17 00:00:00 2001 From: spupyrev Date: Tue, 1 Mar 2022 15:05:44 -0800 Subject: speeding up ext-tsp for huge instances Differential Revision: https://reviews.llvm.org/D120780 --- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp') diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index 5ad3d4d21ce2..e4534ddad103 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -201,6 +201,7 @@ static cl::opt TriangleChainCount( cl::Hidden); extern cl::opt EnableExtTspBlockPlacement; +extern cl::opt ApplyExtTspWithoutProfile; namespace llvm { extern cl::opt StaticLikelyProb; @@ -3419,7 +3420,8 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { } // Apply a post-processing optimizing block placement. - if (MF.size() >= 3 && EnableExtTspBlockPlacement) { + if (MF.size() >= 3 && EnableExtTspBlockPlacement && + (ApplyExtTspWithoutProfile || MF.getFunction().hasProfileData())) { // Find a new placement and modify the layout of the blocks in the function. applyExtTsp(); -- cgit v1.2.3