aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorspupyrev <spupyrev@fb.com>2022-03-01 15:05:44 -0800
committerspupyrev <spupyrev@fb.com>2022-03-02 07:17:48 -0800
commitbcdc0477319a26fd8dcdde5ace3bdd6743599f44 (patch)
tree546f50640de3bb4f73031e34bc73565bc6f469cd /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent59814a8c99768159291188f0981aede567e2a0e5 (diff)
downloadllvm-bcdc0477319a26fd8dcdde5ace3bdd6743599f44.zip
llvm-bcdc0477319a26fd8dcdde5ace3bdd6743599f44.tar.gz
llvm-bcdc0477319a26fd8dcdde5ace3bdd6743599f44.tar.bz2
speeding up ext-tsp for huge instances
Differential Revision: https://reviews.llvm.org/D120780
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 5ad3d4d2..e4534dd 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -201,6 +201,7 @@ static cl::opt<unsigned> TriangleChainCount(
cl::Hidden);
extern cl::opt<bool> EnableExtTspBlockPlacement;
+extern cl::opt<bool> ApplyExtTspWithoutProfile;
namespace llvm {
extern cl::opt<unsigned> 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();