tstellar created this revision. tstellar added reviewers: bogner, dnovillo, hoy, huangjd. Herald added subscribers: wlei, Enna1, ormris, wenlei, hiraditya. Herald added a project: All. tstellar requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits.
This will make it possible to add visibility attributes to these variables. This also fixes some type mismatches between the declaration and the definition. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D156599 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm/ProfileData/ProfileCommon.h llvm/include/llvm/Transforms/IPO/SampleProfile.h llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h llvm/lib/Analysis/ProfileSummaryInfo.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp llvm/tools/llvm-profgen/CSPreInliner.cpp
Index: llvm/tools/llvm-profgen/CSPreInliner.cpp =================================================================== --- llvm/tools/llvm-profgen/CSPreInliner.cpp +++ llvm/tools/llvm-profgen/CSPreInliner.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" +#include "llvm/Transforms/IPO/SampleProfile.h" #include <cstdint> #include <queue> @@ -35,13 +36,6 @@ // TODO: the actual threshold to be tuned here because the size here is based // on machine code not LLVM IR. namespace llvm { -extern cl::opt<int> SampleHotCallSiteThreshold; -extern cl::opt<int> SampleColdCallSiteThreshold; -extern cl::opt<int> ProfileInlineGrowthLimit; -extern cl::opt<int> ProfileInlineLimitMin; -extern cl::opt<int> ProfileInlineLimitMax; -extern cl::opt<bool> SortProfiledSCC; - cl::opt<bool> EnableCSPreInliner( "csspgo-preinliner", cl::Hidden, cl::init(true), cl::desc("Run a global pre-inliner to merge context profile based on " Index: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -327,7 +327,6 @@ // Defined in Analysis/BlockFrequencyInfo.cpp: -view-bfi-func-name= extern cl::opt<std::string> ViewBlockFreqFuncName; -extern cl::opt<bool> DebugInfoCorrelate; } // namespace llvm static cl::opt<bool> Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -47,6 +47,7 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/TargetParser/Triple.h" +#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h" #include "llvm/Transforms/Utils/ModuleUtils.h" #include "llvm/Transforms/Utils/SSAUpdater.h" #include <algorithm> Index: llvm/lib/Analysis/ProfileSummaryInfo.cpp =================================================================== --- llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -23,16 +23,6 @@ #include <optional> using namespace llvm; -// Knobs for profile summary based thresholds. -namespace llvm { -extern cl::opt<int> ProfileSummaryCutoffHot; -extern cl::opt<int> ProfileSummaryCutoffCold; -extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold; -extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold; -extern cl::opt<int> ProfileSummaryHotCount; -extern cl::opt<int> ProfileSummaryColdCount; -} // namespace llvm - static cl::opt<bool> PartialProfile( "partial-profile", cl::Hidden, cl::init(false), cl::desc("Specify the current profile is used as a partial profile.")); Index: llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h =================================================================== --- llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h +++ llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h @@ -18,11 +18,14 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/IR/PassManager.h" +#include "llvm/Support/CommandLine.h" #include <cstdint> #include <string> namespace llvm { +extern cl::opt<bool> DebugInfoCorrelate; + class Function; class Instruction; class Module; Index: llvm/include/llvm/Transforms/IPO/SampleProfile.h =================================================================== --- llvm/include/llvm/Transforms/IPO/SampleProfile.h +++ llvm/include/llvm/Transforms/IPO/SampleProfile.h @@ -17,12 +17,20 @@ #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" +#include "llvm/Support/CommandLine.h" #include <string> namespace llvm { class Module; +extern cl::opt<int> SampleHotCallSiteThreshold; +extern cl::opt<int> SampleColdCallSiteThreshold; +extern cl::opt<int> ProfileInlineGrowthLimit; +extern cl::opt<int> ProfileInlineLimitMin; +extern cl::opt<int> ProfileInlineLimitMax; +extern cl::opt<bool> SortProfiledSCC; + namespace vfs { class FileSystem; } // namespace vfs Index: llvm/include/llvm/ProfileData/ProfileCommon.h =================================================================== --- llvm/include/llvm/ProfileData/ProfileCommon.h +++ llvm/include/llvm/ProfileData/ProfileCommon.h @@ -28,6 +28,14 @@ namespace llvm { +extern cl::opt<bool> UseContextLessSummary; +extern cl::opt<int> ProfileSummaryCutoffHot; +extern cl::opt<int> ProfileSummaryCutoffCold; +extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold; +extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold; +extern cl::opt<uint64_t> ProfileSummaryHotCount; +extern cl::opt<uint64_t> ProfileSummaryColdCount; + namespace sampleprof { class FunctionSamples; Index: clang/lib/CodeGen/BackendUtil.cpp =================================================================== --- clang/lib/CodeGen/BackendUtil.cpp +++ clang/lib/CodeGen/BackendUtil.cpp @@ -69,6 +69,7 @@ #include "llvm/Transforms/Instrumentation/KCFI.h" #include "llvm/Transforms/Instrumentation/MemProfiler.h" #include "llvm/Transforms/Instrumentation/MemorySanitizer.h" +#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h" #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h" #include "llvm/Transforms/Instrumentation/SanitizerCoverage.h" #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h" @@ -89,8 +90,6 @@ #include "llvm/Support/Extension.def" namespace llvm { -extern cl::opt<bool> DebugInfoCorrelate; - // Experiment to move sanitizers earlier. static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP( "sanitizer-early-opt-ep", cl::Optional,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits