[clang] [llvm] [mlir] [polly] Remove unneeded cl::Optional and cl::ZeroOrMore. NFC (PR #225628)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 00:57:47 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Fangrui Song (MaskRay)
<details>
<summary>Changes</summary>
cl::Optional and cl::ZeroOrMore have been no-op since
https://reviews.llvm.org/D120455 removed the "may only occur zero or one
times!" error.
LLM-aided
---
Patch is 88.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/225628.diff
72 Files Affected:
- (modified) bolt/lib/Core/BinaryContext.cpp (+2-4)
- (modified) bolt/lib/Core/BinaryFunction.cpp (+1-2)
- (modified) bolt/lib/Core/BinaryFunctionProfile.cpp (+1-1)
- (modified) bolt/lib/Core/DynoStats.cpp (-1)
- (modified) bolt/lib/Passes/BinaryPasses.cpp (+4-7)
- (modified) bolt/lib/Passes/FrameAnalysis.cpp (+1-1)
- (modified) bolt/lib/Passes/FrameOptimizer.cpp (-1)
- (modified) bolt/lib/Passes/IdenticalCodeFolding.cpp (+1-2)
- (modified) bolt/lib/Passes/IndirectCallPromotion.cpp (+1-1)
- (modified) bolt/lib/Passes/Instrumentation.cpp (+10-12)
- (modified) bolt/lib/Passes/JTFootprintReduction.cpp (+1-1)
- (modified) bolt/lib/Passes/PLTCall.cpp (+1-1)
- (modified) bolt/lib/Passes/ProfileQualityStats.cpp (+2-2)
- (modified) bolt/lib/Passes/ReorderAlgorithm.cpp (+1-1)
- (modified) bolt/lib/Passes/ReorderData.cpp (-1)
- (modified) bolt/lib/Passes/ReorderFunctions.cpp (+3-3)
- (modified) bolt/lib/Passes/RetpolineInsertion.cpp (+2-2)
- (modified) bolt/lib/Passes/ShrinkWrapping.cpp (+1-1)
- (modified) bolt/lib/Passes/StokeInfo.cpp (-1)
- (modified) bolt/lib/Passes/TailDuplication.cpp (+2-2)
- (modified) bolt/lib/Profile/DataAggregator.cpp (+2-4)
- (modified) bolt/lib/Rewrite/BinaryPassManager.cpp (+10-10)
- (modified) bolt/lib/Rewrite/DWARFRewriter.cpp (+1-2)
- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+2-4)
- (modified) bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp (+1-1)
- (modified) bolt/lib/Utils/CommandLineOpts.cpp (+12-15)
- (modified) bolt/tools/driver/llvm-bolt.cpp (-2)
- (modified) bolt/tools/merge-fdata/merge-fdata.cpp (-1)
- (modified) clang/lib/CodeGen/BackendUtil.cpp (+1-1)
- (modified) clang/lib/CodeGen/CGExpr.cpp (+1-1)
- (modified) clang/lib/CodeGen/CoverageMappingGen.cpp (-1)
- (modified) clang/lib/Tooling/CommonOptionsParser.cpp (+1-1)
- (modified) clang/tools/clang-diff/ClangDiff.cpp (+4-5)
- (modified) clang/tools/clang-import-test/clang-import-test.cpp (+3-4)
- (modified) clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp (+1-1)
- (modified) clang/tools/clang-refactor/ClangRefactor.cpp (+3-3)
- (modified) llvm/examples/OrcV2Examples/LLJITDumpObjects/LLJITDumpObjects.cpp (+4-5)
- (modified) llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp (+1-1)
- (modified) llvm/lib/Analysis/IR2Vec.cpp (+5-5)
- (modified) llvm/lib/CodeGen/BasicBlockMatchingAndInference.cpp (+1-1)
- (modified) llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp (+1-1)
- (modified) llvm/lib/CodeGen/GlobalISel/Legalizer.cpp (+2-2)
- (modified) llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp (+1-1)
- (modified) llvm/lib/CodeGen/MIR2Vec.cpp (+9-8)
- (modified) llvm/lib/CodeGen/TargetPassConfig.cpp (+2-2)
- (modified) llvm/lib/IR/OptBisect.cpp (+4-4)
- (modified) llvm/lib/Support/DebugCounter.cpp (-3)
- (modified) llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp (+1-1)
- (modified) llvm/lib/Target/Hexagon/HexagonGlobalScheduler.cpp (+2-2)
- (modified) llvm/lib/Target/Mips/MipsSubtarget.cpp (+1-1)
- (modified) llvm/lib/Target/SPIRV/SPIRVAuxDataHandler.cpp (+1-1)
- (modified) llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp (+1-1)
- (modified) llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp (+1-1)
- (modified) llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp (+1-1)
- (modified) llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp (+3-3)
- (modified) llvm/lib/Transforms/IPO/Instrumentor.cpp (+1-1)
- (modified) llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp (+1-2)
- (modified) llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp (+2-4)
- (modified) llvm/tools/llvm-cov/CodeCoverage.cpp (+45-50)
- (modified) llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp (+1-1)
- (modified) llvm/tools/llvm-jitlink/llvm-jitlink.cpp (+1-1)
- (modified) llvm/tools/llvm-lto2/llvm-lto2.cpp (+1-2)
- (modified) llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp (+10-12)
- (modified) llvm/tools/llvm-profgen/ProfileGenerator.cpp (+4-4)
- (modified) llvm/tools/llvm-split/llvm-split.cpp (+1-1)
- (modified) llvm/tools/llvm-undname/llvm-undname.cpp (+9-10)
- (modified) mlir/lib/Debug/DebugCounter.cpp (+1-1)
- (modified) polly/lib/Analysis/ScopInfo.cpp (+4-3)
- (modified) polly/lib/CodeGen/LoopGenerators.cpp (+3-4)
- (modified) polly/lib/Support/PollyDebug.cpp (+1-1)
- (modified) polly/lib/Transform/MatmulOptimizer.cpp (+3-3)
- (modified) polly/lib/Transform/ScheduleOptimizer.cpp (+1-2)
``````````diff
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index ae320ab695af3e..8e479b92bc75b9 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -65,7 +65,6 @@ static cl::opt<bool>
PrintDebugInfo("print-debug-info",
cl::desc("print debug info when printing functions"),
cl::Hidden,
- cl::ZeroOrMore,
cl::cat(BoltCategory));
cl::opt<bool> PrintRelocations(
@@ -77,7 +76,6 @@ static cl::opt<bool>
PrintMemData("print-mem-data",
cl::desc("print memory data annotations when printing functions"),
cl::Hidden,
- cl::ZeroOrMore,
cl::cat(BoltCategory));
cl::opt<std::string> CompDirOverride(
@@ -90,12 +88,12 @@ cl::opt<std::string> CompDirOverride(
static cl::opt<bool> CloneConstantIsland("clone-constant-island",
cl::desc("clone constant islands"),
cl::Hidden, cl::init(true),
- cl::ZeroOrMore, cl::cat(BoltCategory));
+ cl::cat(BoltCategory));
static cl::opt<bool>
FailOnInvalidPadding("fail-on-invalid-padding", cl::Hidden, cl::init(false),
cl::desc("treat invalid code padding as error"),
- cl::ZeroOrMore, cl::cat(BoltCategory));
+ cl::cat(BoltCategory));
static cl::opt<bool> DropDWOPageCache(
"drop-dwo-page-cache",
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 39c4dd5595e3c1..69eec01e098c1c 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -103,7 +103,6 @@ JumpTables("jump-tables",
clEnumValN(JTS_AGGRESSIVE, "aggressive",
"aggressively split jump tables section based on usage "
"of the tables")),
- cl::ZeroOrMore,
cl::cat(BoltOptCategory));
static cl::opt<bool> NoScan(
@@ -141,7 +140,7 @@ static cl::opt<bool> TrapOnAVX512(
"trap-avx512",
cl::desc("in relocation mode trap upon entry to any function that uses "
"AVX-512 instructions"),
- cl::init(false), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltCategory));
+ cl::init(false), cl::Hidden, cl::cat(BoltCategory));
bool shouldPrint(const BinaryFunction &Function) {
// PLT stubs are disassembled for BTI binaries, therefore they should be
diff --git a/bolt/lib/Core/BinaryFunctionProfile.cpp b/bolt/lib/Core/BinaryFunctionProfile.cpp
index 94091063833c84..b58fba5895c97e 100644
--- a/bolt/lib/Core/BinaryFunctionProfile.cpp
+++ b/bolt/lib/Core/BinaryFunctionProfile.cpp
@@ -36,7 +36,7 @@ cl::opt<IndirectCallPromotionType> ICP(
clEnumValN(ICP_JUMP_TABLES, "jump-tables",
"perform ICP on jump tables"),
clEnumValN(ICP_ALL, "all", "perform ICP on calls and jump tables")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::cat(BoltOptCategory));
static cl::alias ICPAlias("icp",
cl::desc("Alias for --indirect-call-promotion"),
diff --git a/bolt/lib/Core/DynoStats.cpp b/bolt/lib/Core/DynoStats.cpp
index 64a6d12b76e821..4a8f4e72271246 100644
--- a/bolt/lib/Core/DynoStats.cpp
+++ b/bolt/lib/Core/DynoStats.cpp
@@ -33,7 +33,6 @@ extern cl::OptionCategory BoltCategory;
static cl::opt<uint32_t>
DynoStatsScale("dyno-stats-scale",
cl::desc("scale to be applied while reporting dyno stats"),
- cl::Optional,
cl::init(1),
cl::Hidden,
cl::cat(BoltCategory));
diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp
index 4bb3f0988de6b8..b36674344b17fe 100644
--- a/bolt/lib/Passes/BinaryPasses.cpp
+++ b/bolt/lib/Passes/BinaryPasses.cpp
@@ -79,7 +79,6 @@ HotTextMoveSections("hot-text-move-sections",
"the hot text. (default=\'.stub,.mover\')."),
cl::value_desc("sec1,sec2,sec3,..."),
cl::CommaSeparated,
- cl::ZeroOrMore,
cl::cat(BoltCategory));
bool isHotTextMover(const BinaryFunction &Function) {
@@ -110,7 +109,7 @@ static cl::list<Peepholes::PeepholeOpts> Peepholes(
"remove useless conditional branches"),
clEnumValN(Peepholes::PEEP_ALL, "all",
"enable all peephole optimizations")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::cat(BoltOptCategory));
static cl::opt<unsigned>
PrintFuncStat("print-function-statistics",
@@ -135,7 +134,7 @@ static cl::list<bolt::DynoStats::Category>
#undef D
clEnumValN(bolt::DynoStats::LAST_DYNO_STAT, "all",
"sorted by all names")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::cat(BoltOptCategory));
static cl::opt<bool>
PrintUnknown("print-unknown",
@@ -173,7 +172,7 @@ cl::opt<bolt::ReorderBasicBlocks::LayoutType> ReorderBlocks(
"perform layout optimizing I-cache behavior"),
clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_SHUFFLE,
"cluster-shuffle", "perform random layout of clusters")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory),
+ cl::cat(BoltOptCategory),
cl::callback([](const bolt::ReorderBasicBlocks::LayoutType &option) {
if (option == bolt::ReorderBasicBlocks::LT_OPTIMIZE_CACHE_PLUS) {
errs() << "BOLT-WARNING: '-reorder-blocks=cache+' is deprecated, please"
@@ -210,7 +209,6 @@ SctcMode("sctc-mode",
clEnumValN(SctcHeuristic,
"heuristic",
"use branch prediction data to control sctc")),
- cl::ZeroOrMore,
cl::cat(BoltOptCategory));
static cl::opt<unsigned>
@@ -243,8 +241,7 @@ static cl::opt<int> ProfileDensityCutOffHot(
static cl::opt<double> ProfileDensityThreshold(
"profile-density-threshold", cl::init(60),
cl::desc("If the profile density is below the given threshold, it "
- "will be suggested to increase the sampling rate."),
- cl::Optional);
+ "will be suggested to increase the sampling rate."));
} // namespace opts
diff --git a/bolt/lib/Passes/FrameAnalysis.cpp b/bolt/lib/Passes/FrameAnalysis.cpp
index 0b26da33712340..b5a50417285ba5 100644
--- a/bolt/lib/Passes/FrameAnalysis.cpp
+++ b/bolt/lib/Passes/FrameAnalysis.cpp
@@ -41,7 +41,7 @@ static cl::opt<bool> TimeFA("time-fa", cl::desc("time frame analysis steps"),
static cl::opt<bool>
ExperimentalSW("experimental-shrink-wrapping",
cl::desc("process functions with stack pointer arithmetic"),
- cl::ReallyHidden, cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::ReallyHidden, cl::cat(BoltOptCategory));
bool shouldFrameOptimize(const llvm::bolt::BinaryFunction &Function) {
if (Function.hasUnknownControlFlow())
diff --git a/bolt/lib/Passes/FrameOptimizer.cpp b/bolt/lib/Passes/FrameOptimizer.cpp
index b0b7207feac01b..344c6a234e0c40 100644
--- a/bolt/lib/Passes/FrameOptimizer.cpp
+++ b/bolt/lib/Passes/FrameOptimizer.cpp
@@ -40,7 +40,6 @@ FrameOptimization("frame-opt",
clEnumValN(FOP_NONE, "none", "do not perform frame optimization"),
clEnumValN(FOP_HOT, "hot", "perform FOP on hot functions"),
clEnumValN(FOP_ALL, "all", "perform FOP on all functions")),
- cl::ZeroOrMore,
cl::cat(BoltOptCategory));
static cl::opt<bool> RemoveStores(
diff --git a/bolt/lib/Passes/IdenticalCodeFolding.cpp b/bolt/lib/Passes/IdenticalCodeFolding.cpp
index 18c901e45116f1..0c8f01e103a4b6 100644
--- a/bolt/lib/Passes/IdenticalCodeFolding.cpp
+++ b/bolt/lib/Passes/IdenticalCodeFolding.cpp
@@ -43,7 +43,6 @@ static cl::opt<bool>
TimeICF("time-icf",
cl::desc("time icf steps"),
cl::ReallyHidden,
- cl::ZeroOrMore,
cl::cat(BoltOptCategory));
cl::opt<bolt::IdenticalCodeFolding::ICFLevel, false,
@@ -63,7 +62,7 @@ cl::opt<bolt::IdenticalCodeFolding::ICFLevel, false,
"Disable identical code folding (default)"),
clEnumValN(bolt::IdenticalCodeFolding::ICFLevel::Safe,
"safe", "Enable safe identical code folding")),
- cl::ZeroOrMore, cl::ValueOptional, cl::cat(BoltOptCategory));
+ cl::ValueOptional, cl::cat(BoltOptCategory));
} // namespace opts
bool IdenticalCodeFolding::shouldOptimize(const BinaryFunction &BF) const {
diff --git a/bolt/lib/Passes/IndirectCallPromotion.cpp b/bolt/lib/Passes/IndirectCallPromotion.cpp
index 39ae4cda145c45..3384dba63453cc 100644
--- a/bolt/lib/Passes/IndirectCallPromotion.cpp
+++ b/bolt/lib/Passes/IndirectCallPromotion.cpp
@@ -39,7 +39,7 @@ static cl::opt<unsigned> ICPJTRemainingPercentThreshold(
"icp-jt-remaining-percent-threshold",
cl::desc("The percentage threshold against remaining unpromoted indirect "
"call count for the promotion for jump tables"),
- cl::init(30), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
+ cl::init(30), cl::Hidden, cl::cat(BoltOptCategory));
static cl::opt<unsigned> ICPJTTotalPercentThreshold(
"icp-jt-total-percent-threshold",
diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp
index ffcfb264159719..581d720d07db58 100644
--- a/bolt/lib/Passes/Instrumentation.cpp
+++ b/bolt/lib/Passes/Instrumentation.cpp
@@ -31,30 +31,30 @@ cl::opt<std::string> InstrumentationFilename(
"instrumentation-file",
cl::desc("file name where instrumented profile will be saved (default: "
"/tmp/prof.fdata)"),
- cl::init("/tmp/prof.fdata"), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init("/tmp/prof.fdata"), cl::cat(BoltInstrCategory));
cl::opt<std::string> InstrumentationBinpath(
"instrumentation-binpath",
cl::desc("path to instrumented binary in case if /proc/self/map_files "
"is not accessible due to access restriction issues"),
- cl::Optional, cl::cat(BoltInstrCategory));
+ cl::cat(BoltInstrCategory));
cl::opt<bool> InstrumentationFileAppendPID(
"instrumentation-file-append-pid",
cl::desc("append PID to saved profile file name (default: false)"),
- cl::init(false), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(false), cl::cat(BoltInstrCategory));
cl::opt<bool> ConservativeInstrumentation(
"conservative-instrumentation",
cl::desc("disable instrumentation optimizations that sacrifice profile "
"accuracy (for debugging, default: false)"),
- cl::init(false), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(false), cl::cat(BoltInstrCategory));
cl::opt<uint32_t> InstrumentationMaxSize(
"instrumentation-max-size",
cl::desc("Set max memory size of the instrumentation bump allocator "
"default: 0x6400000)"),
- cl::init(0x6400000), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(0x6400000), cl::cat(BoltInstrCategory));
cl::opt<uint32_t> InstrumentationSleepTime(
"instrumentation-sleep-time",
@@ -62,32 +62,30 @@ cl::opt<uint32_t> InstrumentationSleepTime(
"program end). This is useful for service workloads when you "
"want to dump profile every X minutes or if you are killing the "
"program and the profile is not being dumped at the end."),
- cl::init(0), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(0), cl::cat(BoltInstrCategory));
cl::opt<bool> InstrumentationNoCountersClear(
"instrumentation-no-counters-clear",
cl::desc("Don't clear counters across dumps "
"(use with instrumentation-sleep-time option)"),
- cl::init(false), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(false), cl::cat(BoltInstrCategory));
cl::opt<bool> InstrumentationWaitForks(
"instrumentation-wait-forks",
cl::desc("Wait until all forks of instrumented process will finish "
"(use with instrumentation-sleep-time option)"),
- cl::init(false), cl::Optional, cl::cat(BoltInstrCategory));
+ cl::init(false), cl::cat(BoltInstrCategory));
cl::opt<bool>
InstrumentHotOnly("instrument-hot-only",
cl::desc("only insert instrumentation on hot functions "
"(needs profile, default: false)"),
- cl::init(false), cl::Optional,
- cl::cat(BoltInstrCategory));
+ cl::init(false), cl::cat(BoltInstrCategory));
cl::opt<bool> InstrumentCalls("instrument-calls",
cl::desc("record profile for inter-function "
"control flow activity (default: true)"),
- cl::init(true), cl::Optional,
- cl::cat(BoltInstrCategory));
+ cl::init(true), cl::cat(BoltInstrCategory));
} // namespace opts
namespace llvm {
diff --git a/bolt/lib/Passes/JTFootprintReduction.cpp b/bolt/lib/Passes/JTFootprintReduction.cpp
index afd6c0953b906c..f33481397543ac 100644
--- a/bolt/lib/Passes/JTFootprintReduction.cpp
+++ b/bolt/lib/Passes/JTFootprintReduction.cpp
@@ -32,7 +32,7 @@ static cl::opt<bool> JTFootprintOnlyPIC(
"jt-footprint-optimize-for-icache",
cl::desc("with jt-footprint-reduction, only process PIC jumptables and turn"
" off other transformations that increase code size"),
- cl::init(false), cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::init(false), cl::cat(BoltOptCategory));
} // namespace opts
diff --git a/bolt/lib/Passes/PLTCall.cpp b/bolt/lib/Passes/PLTCall.cpp
index a41b3870af666e..c9b66c6fff9271 100644
--- a/bolt/lib/Passes/PLTCall.cpp
+++ b/bolt/lib/Passes/PLTCall.cpp
@@ -33,7 +33,7 @@ static cl::opt<bolt::PLTCall::OptType>
"optimize executed (hot) PLT calls"),
clEnumValN(bolt::PLTCall::OT_ALL, "all",
"optimize all PLT calls")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::cat(BoltOptCategory));
}
namespace llvm {
diff --git a/bolt/lib/Passes/ProfileQualityStats.cpp b/bolt/lib/Passes/ProfileQualityStats.cpp
index f88133714e2061..877f689f8d4497 100644
--- a/bolt/lib/Passes/ProfileQualityStats.cpp
+++ b/bolt/lib/Passes/ProfileQualityStats.cpp
@@ -29,12 +29,12 @@ static cl::opt<unsigned> TopFunctionsForProfileQualityCheck(
"top-functions-for-profile-quality-check",
cl::desc("number of hottest functions to print aggregated "
"profile quality stats of."),
- cl::init(1000), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
+ cl::init(1000), cl::Hidden, cl::cat(BoltOptCategory));
static cl::opt<unsigned> PercentileForProfileQualityCheck(
"percentile-for-profile-quality-check",
cl::desc("Percentile of profile quality distributions over hottest "
"functions to report."),
- cl::init(95), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
+ cl::init(95), cl::Hidden, cl::cat(BoltOptCategory));
} // namespace opts
namespace {
diff --git a/bolt/lib/Passes/ReorderAlgorithm.cpp b/bolt/lib/Passes/ReorderAlgorithm.cpp
index 8fa6b2c53dc875..eb6cfabf4014fe 100644
--- a/bolt/lib/Passes/ReorderAlgorithm.cpp
+++ b/bolt/lib/Passes/ReorderAlgorithm.cpp
@@ -37,7 +37,7 @@ static cl::opt<unsigned> ColdThreshold(
"threshold when evaluating whether a basic block is cold "
"(0 means it is only considered cold if the block has zero "
"samples). Default: 0 "),
- cl::init(0), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
+ cl::init(0), cl::Hidden, cl::cat(BoltOptCategory));
static cl::opt<bool> PrintClusters("print-clusters", cl::desc("print clusters"),
cl::Hidden, cl::cat(BoltOptCategory));
diff --git a/bolt/lib/Passes/ReorderData.cpp b/bolt/lib/Passes/ReorderData.cpp
index cdb38021965f55..a9fb80e6456819 100644
--- a/bolt/lib/Passes/ReorderData.cpp
+++ b/bolt/lib/Passes/ReorderData.cpp
@@ -52,7 +52,6 @@ ReorderAlgorithm("reorder-data-algo",
clEnumValN(REORDER_FUNCS,
"funcs",
"sort hot data by hot function usage and count")),
- cl::ZeroOrMore,
cl::cat(BoltOptCategory));
static cl::opt<unsigned>
diff --git a/bolt/lib/Passes/ReorderFunctions.cpp b/bolt/lib/Passes/ReorderFunctions.cpp
index f38f502e75ced6..9fbf73078a5375 100644
--- a/bolt/lib/Passes/ReorderFunctions.cpp
+++ b/bolt/lib/Passes/ReorderFunctions.cpp
@@ -53,7 +53,7 @@ cl::opt<bolt::ReorderFunctions::ReorderType> ReorderFunctions(
"reorder functions randomly"),
clEnumValN(bolt::ReorderFunctions::RT_USER, "user",
"use function order specified by -function-order")),
- cl::ZeroOrMore, cl::cat(BoltOptCategory),
+ cl::cat(BoltOptCategory),
cl::callback([](const bolt::ReorderFunctions::ReorderType &option) {
if (option == bolt::ReorderFunctions::RT_HFSORT_PLUS) {
errs() << "BOLT-WARNING: '-reorder-functions=hfsort+' is deprecated,"
@@ -94,7 +94,7 @@ static cl::opt<bool> CgFromPerfData(
"cg-from-perf-data",
cl::desc("use perf data directly when constructing the call graph"
" for stale functions"),
- cl::init(true), cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::init(true), cl::cat(BoltOptCategory));
static cl::opt<bool> CgIgnoreRecursiveCalls(
"cg-ignore-recursive-calls",
@@ -105,7 +105,7 @@ static cl::opt<bool> CgUseSplitHotSize(
"cg-use-split-hot-size",
cl::desc("use hot/cold data on basic blocks to determine hot sizes for "
"call graph functions"),
- cl::init(false), cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::init(false), cl::cat(BoltOptCategory));
} // namespace opts
diff --git a/bolt/lib/Passes/RetpolineInsertion.cpp b/bolt/lib/Passes/RetpolineInsertion.cpp
index 4000e59e80ba28..9c3ff80ed6a8cf 100644
--- a/bolt/lib/Passes/RetpolineInsertion.cpp
+++ b/bolt/lib/Passes/RetpolineInsertion.cpp
@@ -42,7 +42,7 @@ static llvm::cl::opt<bool>
static llvm::cl::opt<bool> RetpolineLfence(
"retpoline-lfence",
cl::desc("determine if lfence instruction should exist in the retpoline"),
- cl::init(true), cl::ZeroOrMore, cl::Hidden, cl::cat(BoltCategory));
+ cl::init(true), cl::Hidden, cl::cat(BoltCategory));
static cl::opt<RetpolineInsertion::AvailabilityOptions> R11Availability(
"r11-availability",
@@ -54,7 +54,7 @@ static cl::opt<RetpolineInsertion::AvailabilityOptions> R11Availability(
"always", "r11 available before calls and jumps"),
clEnumValN(RetpolineInsertion::AvailabilityOptions::ABI, "abi",
"r11 available before calls but not before jumps")),
- cl::ZeroOrMore, cl::cat(BoltCategory));
+ cl::cat(BoltCategory));
} // namespace opts
diff --git a/bolt/lib/Passes/ShrinkWrapping.cpp b/bolt/lib/Passes/ShrinkWrapping.cpp
index 5f0af2d68182f1..e9345a2c033a33 100644
--- a/bolt/lib/Passes/ShrinkWrapping.cpp
+++ b/bolt/lib/Passes/ShrinkWrapping.cpp
@@ -32,7 +32,7 @@ static cl::opt<unsigned> ShrinkWrappingThreshold(
cl::desc("Percentage of prologue execution count to use as threshold when"
" evaluating whether a block is cold enough to be profitable to"
" move eligible spills there"),
- cl::init(30), cl::ZeroOrMore, cl::cat(BoltOptCategory));
+ cl::init(30), cl::cat(BoltOptCategory));
} // namespace opts
namespace llvm {
diff --git a/bolt/lib/Passes/StokeInfo.cpp b/bolt/lib/Passes/StokeInfo.cpp
index 05cdf63a4af18a..c3afe21775cb7b 100644
--- a/bolt/lib/Passes/StokeInfo.cpp
+++ b/bolt/lib/Passes/StokeInfo.cpp
@@ -26,7 +26,6 @@ static cl::OptionCategory StokeOptCategory("STOKE pass options");
static cl::opt<std::string>
StokeOutputDataFilename("stoke-out",
cl::desc("output data (.csv) for Stoke's use"),
- cl::Optional,
cl::cat(StokeOptCategory));
}
diff --git a/bolt/lib/Passes/TailDuplication.cpp b/bolt/lib/Passes/TailDuplication.cpp
index a4a5876943ec4c..c8c9298805268d 100644
--- a/bolt/lib/Passes/TailDuplication.cpp
+++ b/bolt/lib/Passes/TailDuplication.cpp
@@ -38,7 +38,7 @@ static cl::opt<bolt::TailDuplication::DuplicationMode> TailDuplicationMode(
"moderate strategy"),
clEnumValN(bolt::TailDuplication::TD_CACHE, "cache",
"cache-aware duplication strategy")),
- cl::ZeroOrMore, cl::Hidden, cl::cat(BoltOptCategory));
+ cl::Hidden, cl::cat(BoltOptCategory));
static cl::opt<unsigned>
TailDuplicationMinimumOffset("...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/225628
More information about the llvm-commits
mailing list