summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-01-17 21:29:34 +0000
committerVedant Kumar <vsk@apple.com>2019-01-17 21:29:34 +0000
commit32a014d0483e821566e42d68e270f53456b9b1df (patch)
treeb923389c990d518db8d48cab7a4f25ca84b93377 /llvm/lib
parent48807d0d35638911e9dc65ae793234f2f3f582cb (diff)
downloadbcm5719-llvm-32a014d0483e821566e42d68e270f53456b9b1df.tar.gz
bcm5719-llvm-32a014d0483e821566e42d68e270f53456b9b1df.zip
[HotColdSplit] Simplify tests by lowering their splitting thresholds
This gets rid of the brittle/mysterious calls to @sink()/@sideeffect() peppered throughout the test cases. They are no longer needed to force splitting to occur. llvm-svn: 351480
Diffstat (limited to 'llvm/lib')
-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