I'm seeing ext-tsp helps CSSPGO for our intern large benchmarks so I'm turning on it for CSSPGO. For non-CS AutoFDO, ext-tsp doesn't seem to help, probably because of lower profile counts quality.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/
D119048
cl::init(2),
cl::Hidden);
-static cl::opt<bool> EnableExtTspBlockPlacement(
- "enable-ext-tsp-block-placement", cl::Hidden, cl::init(false),
- cl::desc("Enable machine block placement based on the ext-tsp model, "
- "optimizing I-cache utilization."));
+extern cl::opt<bool> EnableExtTspBlockPlacement;
namespace llvm {
extern cl::opt<unsigned> StaticLikelyProb;
"overwrite-existing-weights", cl::Hidden, cl::init(false),
cl::desc("Ignore existing branch weights on IR and always overwrite."));
+extern cl::opt<bool> EnableExtTspBlockPlacement;
+
namespace {
using BlockWeightMap = DenseMap<const BasicBlock *, uint64_t>;
if (!SampleProfileUseProfi.getNumOccurrences())
SampleProfileUseProfi = true;
+ // Enable EXT-TSP block layout for CSSPGO.
+ if (!EnableExtTspBlockPlacement.getNumOccurrences())
+ EnableExtTspBlockPlacement = true;
+
if (FunctionSamples::ProfileIsCSFlat) {
// Tracker for profiles under different context
ContextTracker = std::make_unique<SampleContextTracker>(
using namespace llvm;
#define DEBUG_TYPE "code-layout"
+cl::opt<bool> EnableExtTspBlockPlacement(
+ "enable-ext-tsp-block-placement", cl::Hidden, cl::init(false),
+ cl::desc("Enable machine block placement based on the ext-tsp model, "
+ "optimizing I-cache utilization."));
+
// Algorithm-specific constants. The values are tuned for the best performance
// of large-scale front-end bound binaries.
static cl::opt<double>