summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/HotColdSplitting.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index 924a7d5fbd9..d0f3fdf0c60 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -69,9 +69,9 @@ static cl::opt<bool> EnableStaticAnalyis("hot-cold-static-analysis",
cl::init(true), cl::Hidden);
static cl::opt<int>
- MinOutliningThreshold("min-outlining-thresh", cl::init(3), cl::Hidden,
- cl::desc("Code size threshold for outlining within a "
- "single BB (as a multiple of TCC_Basic)"));
+ SplittingThreshold("hotcoldsplit-threshold", cl::init(3), cl::Hidden,
+ cl::desc("Code size threshold for splitting cold code "
+ "(as a multiple of TCC_Basic)"));
namespace {
@@ -131,6 +131,11 @@ static bool mayExtractBlock(const BasicBlock &BB) {
/// Check whether \p Region is profitable to outline.
static bool isProfitableToOutline(const BlockSequence &Region,
TargetTransformInfo &TTI) {
+ // If the splitting threshold is set at or below zero, skip the usual
+ // profitability check.
+ if (SplittingThreshold <= 0)
+ return true;
+
if (Region.size() > 1)
return true;
@@ -142,7 +147,7 @@ static bool isProfitableToOutline(const BlockSequence &Region,
Cost += TTI.getInstructionCost(&I, TargetTransformInfo::TCK_CodeSize);
- if (Cost >= (MinOutliningThreshold * TargetTransformInfo::TCC_Basic))
+ if (Cost >= (SplittingThreshold * TargetTransformInfo::TCC_Basic))
return true;
}
return false;
OpenPOWER on IntegriCloud