#define DEBUG_TYPE "block-freq"
-extern llvm::cl::opt<bool> CheckBFIUnknownBlockQueries;
-
namespace llvm {
+extern llvm::cl::opt<bool> CheckBFIUnknownBlockQueries;
class BranchProbabilityInfo;
class Function;
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Support/CommandLine.h"
-extern llvm::cl::opt<bool> EnablePGSO;
-extern llvm::cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
-extern llvm::cl::opt<bool> PGSOColdCodeOnly;
-extern llvm::cl::opt<bool> PGSOColdCodeOnlyForInstrPGO;
-extern llvm::cl::opt<bool> PGSOColdCodeOnlyForSamplePGO;
-extern llvm::cl::opt<bool> PGSOColdCodeOnlyForPartialSamplePGO;
-extern llvm::cl::opt<bool> ForcePGSO;
-extern llvm::cl::opt<int> PgsoCutoffInstrProf;
-extern llvm::cl::opt<int> PgsoCutoffSampleProf;
-
namespace llvm {
+extern cl::opt<bool> EnablePGSO;
+extern cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
+extern cl::opt<bool> PGSOColdCodeOnly;
+extern cl::opt<bool> PGSOColdCodeOnlyForInstrPGO;
+extern cl::opt<bool> PGSOColdCodeOnlyForSamplePGO;
+extern cl::opt<bool> PGSOColdCodeOnlyForPartialSamplePGO;
+extern cl::opt<bool> ForcePGSO;
+extern cl::opt<int> PgsoCutoffInstrProf;
+extern cl::opt<int> PgsoCutoffSampleProf;
class BasicBlock;
class BlockFrequencyInfo;
STATISTIC(NumMayAlias, "Number of MayAlias results");
STATISTIC(NumMustAlias, "Number of MustAlias results");
+namespace llvm {
/// Allow disabling BasicAA from the AA results. This is particularly useful
/// when testing to isolate a single AA implementation.
cl::opt<bool> DisableBasicAA("disable-basic-aa", cl::Hidden, cl::init(false));
+} // namespace llvm
#ifndef NDEBUG
/// Print a trace of alias analysis queries and their results.
clEnumValN(GVDT_Count, "count", "display a graph using the real "
"profile count if available.")));
+namespace llvm {
cl::opt<std::string>
ViewBlockFreqFuncName("view-bfi-func-name", cl::Hidden,
cl::desc("The option to specify "
"print-bfi-func-name", cl::Hidden,
cl::desc("The option to specify the name of the function "
"whose block frequency info is printed."));
+} // namespace llvm
namespace llvm {
#define DEBUG_TYPE "block-freq"
+namespace llvm {
cl::opt<bool> CheckBFIUnknownBlockQueries(
"check-bfi-unknown-block-queries",
cl::init(false), cl::Hidden,
cl::desc("Check if block frequency is queried for an unknown block "
"for debugging missed BFI updates"));
+}
ScaledNumber<uint64_t> BlockMass::toScaled() const {
if (isFull())
#define DEBUG_TYPE "cgscc-passmgr"
+namespace llvm {
cl::opt<unsigned> MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden,
cl::init(4));
+}
STATISTIC(MaxSCCIterations, "Maximum CGSCCPassMgr iterations on one SCC");
#define DEBUG_TYPE "machine-block-freq"
+namespace llvm {
static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG(
"view-machine-block-freq-propagation-dags", cl::Hidden,
cl::desc("Pop up a window to show a dag displaying how machine block "
// Command line option to specify the name of the function for block frequency
// dump. Defined in Analysis/BlockFrequencyInfo.cpp.
extern cl::opt<std::string> PrintBlockFreqFuncName;
+} // namespace llvm
static GVDAGType getGVDT() {
if (ViewBlockLayoutWithBFI != GVDT_None)
cl::init(2),
cl::Hidden);
+namespace llvm {
extern cl::opt<unsigned> StaticLikelyProb;
extern cl::opt<unsigned> ProfileLikelyProb;
// Command line option to specify the name of the function for CFG dump
// Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name=
extern cl::opt<std::string> ViewBlockFreqFuncName;
+} // namespace llvm
namespace {
INITIALIZE_PASS_END(MachineBranchProbabilityInfo, "machine-branch-prob",
"Machine Branch Probability Analysis", false, true)
+namespace llvm {
cl::opt<unsigned>
StaticLikelyProb("static-likely-prob",
cl::desc("branch probability threshold in percentage"
cl::desc("branch probability threshold in percentage to be considered"
" very likely when profile is available"),
cl::init(51), cl::Hidden);
+} // namespace llvm
char MachineBranchProbabilityInfo::ID = 0;
"thinlto-synthesize-entry-counts", cl::init(false), cl::Hidden,
cl::desc("Synthesize entry counts based on the summary"));
+namespace llvm {
extern cl::opt<int> InitialSyntheticCount;
+}
static void initializeCounts(ModuleSummaryIndex &Index) {
auto Root = Index.calculateCallGraphRoot();
using namespace llvm;
+namespace {
enum DefaultOnOff { Default, Enable, Disable };
+}
static cl::opt<DefaultOnOff> DwarfExtendedLoc(
"dwarf-extended-loc", cl::Hidden,
cl::desc("Disable emission of the extended flags in .loc directives."),
clEnumVal(Enable, "Enabled"), clEnumVal(Disable, "Disabled")),
cl::init(Default));
+namespace llvm {
cl::opt<cl::boolOrDefault> UseLEB128Directives(
"use-leb128-directives", cl::Hidden,
cl::desc(
"Disable the usage of LEB128 directives, and generate .byte instead."),
cl::init(cl::BOU_UNSET));
+}
MCAsmInfo::MCAsmInfo() {
SeparatorString = ";";
using namespace llvm;
+namespace llvm {
extern cl::opt<cl::boolOrDefault> UseLEB128Directives;
+}
void MCAsmInfoXCOFF::anchor() {}
using namespace llvm;
-extern cl::opt<unsigned> MaxDevirtIterations;
-
static cl::opt<InliningAdvisorMode> UseInlineAdvisor(
"enable-ml-inliner", cl::init(InliningAdvisorMode::Default), cl::Hidden,
cl::desc("Enable ML policy for inliner. Currently trained for -Oz only"),
CallGraphProfile = true;
MergeFunctions = false;
}
-extern cl::opt<bool> ExtraVectorizerPasses;
+namespace llvm {
+extern cl::opt<unsigned> MaxDevirtIterations;
extern cl::opt<bool> EnableConstraintElimination;
extern cl::opt<bool> EnableGVNHoist;
extern cl::opt<bool> EnableGVNSink;
extern cl::opt<bool> EnableLoopFlatten;
extern cl::opt<bool> RunNewGVN;
extern cl::opt<bool> RunPartialInlining;
+extern cl::opt<bool> ExtraVectorizerPasses;
extern cl::opt<bool> FlattenedProfileUsed;
extern cl::opt<bool> DisablePreInliner;
extern cl::opt<int> PreInlineThreshold;
+} // namespace llvm
const PassBuilder::OptimizationLevel PassBuilder::OptimizationLevel::O0 = {
/*SpeedLevel*/ 0,
"extract-blocks-file", cl::value_desc("filename"),
cl::desc("A file containing list of basic blocks to extract"), cl::Hidden);
-cl::opt<bool> BlockExtractorEraseFuncs("extract-blocks-erase-funcs",
- cl::desc("Erase the existing functions"),
- cl::Hidden);
+static cl::opt<bool>
+ BlockExtractorEraseFuncs("extract-blocks-erase-funcs",
+ cl::desc("Erase the existing functions"),
+ cl::Hidden);
namespace {
class BlockExtractor {
public:
using namespace llvm;
+namespace llvm {
cl::opt<bool> RunPartialInlining("enable-partial-inlining", cl::init(false),
cl::Hidden, cl::ZeroOrMore,
cl::desc("Run Partial inlinining pass"));
"disable attributor runs")));
extern cl::opt<bool> EnableKnowledgeRetention;
+} // namespace llvm
PassManagerBuilder::PassManagerBuilder() {
OptLevel = 2;
#define DEBUG_TYPE "synthetic-counts-propagation"
-/// Initial synthetic count assigned to functions.
+namespace llvm {
cl::opt<int>
InitialSyntheticCount("initial-synthetic-count", cl::Hidden, cl::init(10),
cl::ZeroOrMore,
- cl::desc("Initial value of synthetic entry count."));
+ cl::desc("Initial value of synthetic entry count"));
+} // namespace llvm
/// Initial synthetic count assigned to inline functions.
static cl::opt<int> InlineSyntheticCount(
/// This is needed to support legacy tests that don't contain
/// !vcall_visibility metadata (the mere presense of type tests
/// previously implied hidden visibility).
-cl::opt<bool>
+static cl::opt<bool>
WholeProgramVisibility("whole-program-visibility", cl::init(false),
cl::Hidden, cl::ZeroOrMore,
cl::desc("Enable whole program visibility"));
/// Provide a way to force disable whole program for debugging or workarounds,
/// when enabled via the linker.
-cl::opt<bool> DisableWholeProgramVisibility(
+static cl::opt<bool> DisableWholeProgramVisibility(
"disable-whole-program-visibility", cl::init(false), cl::Hidden,
cl::ZeroOrMore,
cl::desc("Disable whole program visibility (overrides enabling options)"));
/// Provide way to prevent certain function from being devirtualized
-cl::list<std::string>
+static cl::list<std::string>
SkipFunctionNames("wholeprogramdevirt-skip",
cl::desc("Prevent function(s) from being devirtualized"),
cl::Hidden, cl::ZeroOrMore, cl::CommaSeparated);
/// Mechanism to add runtime checking of devirtualization decisions, trapping on
/// any that are not correct. Useful for debugging undefined behavior leading to
/// failures with WPD.
-cl::opt<bool>
+static cl::opt<bool>
CheckDevirt("wholeprogramdevirt-check", cl::init(false), cl::Hidden,
cl::ZeroOrMore,
cl::desc("Add code to trap on incorrect devirtualizations"));
cl::desc("How wide an instruction window to bypass looking for "
"another guard"));
+namespace llvm {
/// enable preservation of attributes in assume like:
/// call void @llvm.assume(i1 true) [ "nonnull"(i32* %PTR) ]
extern cl::opt<bool> EnableKnowledgeRetention;
+} // namespace llvm
/// Return the specified type promoted as it would be to pass though a va_arg
/// area.
cl::desc("Set the threshold for pgo-verify-bfi -- skip the counts whose "
"profile count value is below."));
+namespace llvm {
// Command line option to turn on CFG dot dump after profile annotation.
// Defined in Analysis/BlockFrequencyInfo.cpp: -pgo-view-counts
extern cl::opt<PGOViewCountsType> PGOViewCounts;
// Command line option to specify the name of the function for CFG dump
// Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name=
extern cl::opt<std::string> ViewBlockFreqFuncName;
+} // namespace llvm
static cl::opt<bool>
PGOOldCFGHashing("pgo-instr-old-cfg-hashing", cl::init(false), cl::Hidden,
using namespace llvm;
+namespace llvm {
cl::opt<bool> ShouldPreserveAllAttributes(
"assume-preserve-all", cl::init(false), cl::Hidden,
cl::desc("enable preservation of all attrbitues. even those that are "
"enable-knowledge-retention", cl::init(false), cl::Hidden,
cl::desc(
"enable preservation of attributes throughout code transformation"));
+} // namespace llvm
#define DEBUG_TYPE "assume-builder"
using namespace llvm;
-cl::opt<bool> EnablePGSO(
+cl::opt<bool> llvm::EnablePGSO(
"pgso", cl::Hidden, cl::init(true),
cl::desc("Enable the profile guided size optimizations. "));
-cl::opt<bool> PGSOLargeWorkingSetSizeOnly(
+cl::opt<bool> llvm::PGSOLargeWorkingSetSizeOnly(
"pgso-lwss-only", cl::Hidden, cl::init(true),
cl::desc("Apply the profile guided size optimizations only "
"if the working set size is large (except for cold code.)"));
-cl::opt<bool> PGSOColdCodeOnly(
+cl::opt<bool> llvm::PGSOColdCodeOnly(
"pgso-cold-code-only", cl::Hidden, cl::init(false),
cl::desc("Apply the profile guided size optimizations only "
"to cold code."));
-cl::opt<bool> PGSOColdCodeOnlyForInstrPGO(
+cl::opt<bool> llvm::PGSOColdCodeOnlyForInstrPGO(
"pgso-cold-code-only-for-instr-pgo", cl::Hidden, cl::init(false),
cl::desc("Apply the profile guided size optimizations only "
"to cold code under instrumentation PGO."));
-cl::opt<bool> PGSOColdCodeOnlyForSamplePGO(
+cl::opt<bool> llvm::PGSOColdCodeOnlyForSamplePGO(
"pgso-cold-code-only-for-sample-pgo", cl::Hidden, cl::init(false),
cl::desc("Apply the profile guided size optimizations only "
"to cold code under sample PGO."));
-cl::opt<bool> PGSOColdCodeOnlyForPartialSamplePGO(
+cl::opt<bool> llvm::PGSOColdCodeOnlyForPartialSamplePGO(
"pgso-cold-code-only-for-partial-sample-pgo", cl::Hidden, cl::init(false),
cl::desc("Apply the profile guided size optimizations only "
"to cold code under partial-profile sample PGO."));
-cl::opt<bool> ForcePGSO(
+cl::opt<bool> llvm::ForcePGSO(
"force-pgso", cl::Hidden, cl::init(false),
cl::desc("Force the (profiled-guided) size optimizations. "));
-cl::opt<int> PgsoCutoffInstrProf(
+cl::opt<int> llvm::PgsoCutoffInstrProf(
"pgso-cutoff-instr-prof", cl::Hidden, cl::init(950000), cl::ZeroOrMore,
cl::desc("The profile guided size optimization profile summary cutoff "
"for instrumentation profile."));
-cl::opt<int> PgsoCutoffSampleProf(
+cl::opt<int> llvm::PgsoCutoffSampleProf(
"pgso-cutoff-sample-prof", cl::Hidden, cl::init(990000), cl::ZeroOrMore,
cl::desc("The profile guided size optimization profile summary cutoff "
"for sample profile."));
// Individual pipeline tuning options.
extern cl::opt<bool> DisableLoopUnrolling;
+namespace llvm {
extern cl::opt<PGOKind> PGOKindFlag;
extern cl::opt<std::string> ProfileFile;
extern cl::opt<CSPGOKind> CSPGOKindFlag;
extern cl::opt<std::string> CSProfileGenFile;
extern cl::opt<bool> DisableBasicAA;
+} // namespace llvm
static cl::opt<std::string>
ProfileRemappingFile("profile-remapping-file",
cl::desc("The format used for serializing remarks (default: YAML)"),
cl::value_desc("format"), cl::init("yaml"));
+namespace llvm {
cl::opt<PGOKind>
PGOKindFlag("pgo-kind", cl::init(NoPGO), cl::Hidden,
cl::desc("The kind of profile guided optimization"),
"cs-profilegen-file",
cl::desc("Path to the instrumented context sensitive profile."),
cl::Hidden);
+} // namespace llvm
static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
// Add the pass to the pass manager...
using namespace llvm;
+namespace llvm {
extern cl::opt<bool> ShouldPreserveAllAttributes;
extern cl::opt<bool> EnableKnowledgeRetention;
+} // namespace llvm
static void RunTest(
StringRef Head, StringRef Tail,
#define SCOP_STAT(NAME, DESC) \
{ "polly-detect", "NAME", "Number of rejected regions: " DESC }
-Statistic RejectStatistics[] = {
+static Statistic RejectStatistics[] = {
SCOP_STAT(CFG, ""),
SCOP_STAT(InvalidTerminator, "Unsupported terminator instruction"),
SCOP_STAT(UnreachableInExit, "Unreachable in exit block"),