From 95a134254a403750ddfee7c056efdf2359a7dc8c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 5 Jun 2022 01:07:50 -0700 Subject: Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options --- polly/lib/Analysis/DependenceInfo.cpp | 6 ++---- polly/lib/Analysis/ScopDetection.cpp | 6 +++--- polly/lib/Analysis/ScopInfo.cpp | 3 +-- polly/lib/CodeGen/BlockGenerators.cpp | 3 +-- polly/lib/CodeGen/CodeGeneration.cpp | 4 ++-- polly/lib/CodeGen/IslAst.cpp | 2 +- polly/lib/CodeGen/IslExprBuilder.cpp | 2 +- polly/lib/CodeGen/ManagedMemoryRewrite.cpp | 2 +- polly/lib/CodeGen/PPCGCodeGeneration.cpp | 22 +++++++++++----------- polly/lib/Support/RegisterPasses.cpp | 11 +++++------ polly/lib/Transform/DeadCodeElimination.cpp | 2 +- polly/lib/Transform/MatmulOptimizer.cpp | 4 ++-- polly/lib/Transform/ScheduleOptimizer.cpp | 6 +++--- 13 files changed, 34 insertions(+), 39 deletions(-) (limited to 'polly') diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index dc6ed169..f29355ff 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -66,8 +66,7 @@ static cl::opt OptAnalysisType( "Exact dependences without transitive dependences"), clEnumValN(MEMORY_BASED_ANALYSIS, "memory-based", "Overapproximation of dependences")), - cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::ZeroOrMore, - cl::cat(PollyCategory)); + cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::cat(PollyCategory)); static cl::opt OptAnalysisLevel( "polly-dependences-analysis-level", @@ -80,8 +79,7 @@ static cl::opt OptAnalysisLevel( clEnumValN(Dependences::AL_Access, "access-wise", "Memory reference level analysis that distinguish" " access instructions in the same statement")), - cl::Hidden, cl::init(Dependences::AL_Statement), cl::ZeroOrMore, - cl::cat(PollyCategory)); + cl::Hidden, cl::init(Dependences::AL_Statement), cl::cat(PollyCategory)); //===----------------------------------------------------------------------===// diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index f9c39c1..9d7b4c4 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -117,7 +117,7 @@ static cl::list OnlyFunctions( "Multiple regexes can be comma separated. " "Scop detection will run on all functions that match " "ANY of the regexes provided."), - cl::ZeroOrMore, cl::CommaSeparated, cl::cat(PollyCategory)); + cl::CommaSeparated, cl::cat(PollyCategory)); static cl::list IgnoredFunctions( "polly-ignore-func", @@ -125,7 +125,7 @@ static cl::list IgnoredFunctions( "Multiple regexes can be comma separated. " "Scop detection will ignore all functions that match " "ANY of the regexes provided."), - cl::ZeroOrMore, cl::CommaSeparated, cl::cat(PollyCategory)); + cl::CommaSeparated, cl::cat(PollyCategory)); bool polly::PollyAllowFullFunction; @@ -207,7 +207,7 @@ static cl::opt PollyDelinearizeX("polly-delinearize", cl::desc("Delinearize array access functions"), cl::location(PollyDelinearize), cl::Hidden, - cl::ZeroOrMore, cl::init(true), cl::cat(PollyCategory)); + cl::init(true), cl::cat(PollyCategory)); static cl::opt VerifyScops("polly-detect-verify", diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 0649908..ca81d43 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -155,8 +155,7 @@ bool polly::UseInstructionNames; static cl::opt XUseInstructionNames( "polly-use-llvm-names", cl::desc("Use LLVM-IR names when deriving statement names"), - cl::location(UseInstructionNames), cl::Hidden, cl::init(false), - cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::location(UseInstructionNames), cl::Hidden, cl::cat(PollyCategory)); static cl::opt PollyPrintInstructions( "polly-print-instructions", cl::desc("Output instructions per ScopStmt"), diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 2f7d7a9..a98cfa1 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -39,8 +39,7 @@ bool PollyDebugPrinting; static cl::opt DebugPrintingX( "polly-codegen-add-debug-printing", cl::desc("Add printf calls that show the values loaded/stored."), - cl::location(PollyDebugPrinting), cl::Hidden, cl::init(false), - cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::location(PollyDebugPrinting), cl::Hidden, cl::cat(PollyCategory)); static cl::opt TraceStmts( "polly-codegen-trace-stmts", diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index f3e8068..b124525 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -58,8 +58,8 @@ bool polly::PerfMonitoring; static cl::opt XPerfMonitoring("polly-codegen-perf-monitoring", cl::desc("Add run-time performance monitoring"), cl::Hidden, - cl::location(polly::PerfMonitoring), cl::init(false), - cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::location(polly::PerfMonitoring), + cl::cat(PollyCategory)); STATISTIC(ScopsProcessed, "Number of SCoP processed"); STATISTIC(CodegenedScops, "Number of successfully generated SCoPs"); diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 338be5b..5041db9 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -72,7 +72,7 @@ static cl::opt PollyParallelForce( "polly-parallel-force", cl::desc( "Force generation of thread parallel code ignoring any cost model"), - cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::cat(PollyCategory)); static cl::opt UseContext("polly-ast-use-context", cl::desc("Use context"), cl::Hidden, diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp index dab0ca1..12b724c 100644 --- a/polly/lib/CodeGen/IslExprBuilder.cpp +++ b/polly/lib/CodeGen/IslExprBuilder.cpp @@ -34,7 +34,7 @@ static cl::opt OTMode( "Track the overflow bit if requested."), clEnumValN(OT_ALWAYS, "always", "Always track the overflow bit.")), - cl::Hidden, cl::init(OT_REQUEST), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(OT_REQUEST), cl::cat(PollyCategory)); IslExprBuilder::IslExprBuilder(Scop &S, PollyIRBuilder &Builder, IDToValueTy &IDToValue, ValueMapT &GlobalMap, diff --git a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp index a397692..e074917 100644 --- a/polly/lib/CodeGen/ManagedMemoryRewrite.cpp +++ b/polly/lib/CodeGen/ManagedMemoryRewrite.cpp @@ -40,7 +40,7 @@ static cl::opt IgnoreLinkageForGlobals( cl::desc( "By default, we only rewrite globals with internal linkage. This flag " "enables rewriting of globals regardless of linkage"), - cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::cat(PollyCategory)); #define DEBUG_TYPE "polly-acc-rewrite-managed-memory" namespace { diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 5f3659e..170f08e 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -87,7 +87,7 @@ static cl::opt " that all memory has been" " declared as managed memory"), cl::location(PollyManagedMemory), cl::Hidden, - cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::init(false), cl::cat(PollyCategory)); static cl::opt FailOnVerifyModuleFailure("polly-acc-fail-on-verify-module-failure", @@ -112,14 +112,15 @@ static cl::opt cl::Hidden, cl::init(10 * 512 * 512)); GPURuntime polly::GPURuntimeChoice; -static cl::opt XGPURuntimeChoice( - "polly-gpu-runtime", cl::desc("The GPU Runtime API to target"), - cl::values(clEnumValN(GPURuntime::CUDA, "libcudart", - "use the CUDA Runtime API"), - clEnumValN(GPURuntime::OpenCL, "libopencl", - "use the OpenCL Runtime API")), - cl::location(polly::GPURuntimeChoice), cl::init(GPURuntime::CUDA), - cl::ZeroOrMore, cl::cat(PollyCategory)); +static cl::opt + XGPURuntimeChoice("polly-gpu-runtime", + cl::desc("The GPU Runtime API to target"), + cl::values(clEnumValN(GPURuntime::CUDA, "libcudart", + "use the CUDA Runtime API"), + clEnumValN(GPURuntime::OpenCL, "libopencl", + "use the OpenCL Runtime API")), + cl::location(polly::GPURuntimeChoice), + cl::init(GPURuntime::CUDA), cl::cat(PollyCategory)); GPUArch polly::GPUArchChoice; static cl::opt @@ -131,8 +132,7 @@ static cl::opt clEnumValN(GPUArch::SPIR64, "spir64", "target SPIR 64-bit architecture")), cl::location(polly::GPUArchChoice), - cl::init(GPUArch::NVPTX64), cl::ZeroOrMore, - cl::cat(PollyCategory)); + cl::init(GPUArch::NVPTX64), cl::cat(PollyCategory)); extern bool polly::PerfMonitoring; diff --git a/polly/lib/Support/RegisterPasses.cpp b/polly/lib/Support/RegisterPasses.cpp index bd99bd1..2c81f946 100644 --- a/polly/lib/Support/RegisterPasses.cpp +++ b/polly/lib/Support/RegisterPasses.cpp @@ -88,8 +88,7 @@ static cl::opt PassPosition( "After the loop optimizer (but within the inline cycle)"), clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer", "Right before the vectorizer")), - cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::ZeroOrMore, - cl::cat(PollyCategory)); + cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::cat(PollyCategory)); static cl::opt Optimizer("polly-optimizer", cl::desc("Select the scheduling optimizer"), @@ -104,7 +103,7 @@ static cl::opt CodeGeneration( cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"), clEnumValN(CODEGEN_AST, "ast", "Only AST generation"), clEnumValN(CODEGEN_NONE, "none", "No code generation")), - cl::Hidden, cl::init(CODEGEN_FULL), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(CODEGEN_FULL), cl::cat(PollyCategory)); enum TargetChoice { TARGET_CPU, TARGET_GPU, TARGET_HYBRID }; static cl::opt @@ -117,7 +116,7 @@ static cl::opt "generate GPU code (preferably) or CPU code") #endif ), - cl::init(TARGET_CPU), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::init(TARGET_CPU), cl::cat(PollyCategory)); VectorizerChoice PollyVectorizerChoice; @@ -130,7 +129,7 @@ static cl::opt Vectorizer( VECTORIZER_STRIPMINE, "stripmine", "Strip-mine outer loops for the loop-vectorizer to trigger")), cl::location(PollyVectorizerChoice), cl::init(VECTORIZER_NONE), - cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::cat(PollyCategory)); static cl::opt ImportJScop( "polly-import", @@ -155,7 +154,7 @@ static cl::opt PollyViewer( "polly-show", cl::desc("Highlight the code regions that will be optimized in a " "(CFG BBs and LLVM-IR instructions)"), - cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::cat(PollyCategory)); static cl::opt PollyOnlyViewer( "polly-show-only", diff --git a/polly/lib/Transform/DeadCodeElimination.cpp b/polly/lib/Transform/DeadCodeElimination.cpp index 42b48f4..5cb89fe 100644 --- a/polly/lib/Transform/DeadCodeElimination.cpp +++ b/polly/lib/Transform/DeadCodeElimination.cpp @@ -49,7 +49,7 @@ cl::opt DCEPreciseSteps( cl::desc("The number of precise steps between two approximating " "iterations. (A value of -1 schedules another approximation stage " "before the actual dead code elimination."), - cl::ZeroOrMore, cl::init(-1), cl::cat(PollyCategory)); + cl::init(-1), cl::cat(PollyCategory)); class DeadCodeElimWrapperPass final : public ScopPass { public: diff --git a/polly/lib/Transform/MatmulOptimizer.cpp b/polly/lib/Transform/MatmulOptimizer.cpp index 84c7da6..4a40fac 100644 --- a/polly/lib/Transform/MatmulOptimizer.cpp +++ b/polly/lib/Transform/MatmulOptimizer.cpp @@ -54,14 +54,14 @@ static cl::opt LatencyVectorFma( cl::desc("The minimal number of cycles between issuing two " "dependent consecutive vector fused multiply-add " "instructions."), - cl::Hidden, cl::init(8), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(8), cl::cat(PollyCategory)); static cl::opt ThroughputVectorFma( "polly-target-throughput-vector-fma", cl::desc("A throughput of the processor floating-point arithmetic units " "expressed in the number of vector fused multiply-add " "instructions per clock cycle."), - cl::Hidden, cl::init(1), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(1), cl::cat(PollyCategory)); static cl::opt FirstCacheLevelSize( "polly-target-1st-cache-level-size", diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index cc139c1..c036651 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -121,7 +121,7 @@ static cl::opt FirstLevelDefaultTileSize( "polly-default-tile-size", cl::desc("The default tile size (if not enough were provided by" " --polly-tile-sizes)"), - cl::Hidden, cl::init(32), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(32), cl::cat(PollyCategory)); static cl::list FirstLevelTileSizes("polly-tile-sizes", @@ -155,7 +155,7 @@ static cl::opt RegisterDefaultTileSize( "polly-register-tiling-default-tile-size", cl::desc("The default register tile size (if not enough were provided by" " --polly-register-tile-sizes)"), - cl::Hidden, cl::init(2), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::Hidden, cl::init(2), cl::cat(PollyCategory)); static cl::list RegisterTileSizes("polly-register-tile-sizes", @@ -188,7 +188,7 @@ static cl::opt OptimizedScops( cl::desc("Polly - Dump polyhedral description of Scops optimized with " "the isl scheduling optimizer and the set of post-scheduling " "transformations is applied on the schedule tree"), - cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); + cl::cat(PollyCategory)); STATISTIC(ScopsProcessed, "Number of scops processed"); STATISTIC(ScopsRescheduled, "Number of scops rescheduled"); -- cgit v1.1