From 32a014d0483e821566e42d68e270f53456b9b1df Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 17 Jan 2019 21:29:34 +0000 Subject: [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 --- llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'llvm/lib') 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 EnableStaticAnalyis("hot-cold-static-analysis", cl::init(true), cl::Hidden); static cl::opt - 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; -- cgit v1.2.3