[llvm-branch-commits] [llvm] 012438a - Revert "[Passes] Expose parseSinglePassOption (#86117)"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Mar 21 17:54:04 PDT 2024
Author: paperchalice
Date: 2024-03-22T08:54:02+08:00
New Revision: 012438a2760b5bf89daa7e9b18848510f514d09c
URL: https://github.com/llvm/llvm-project/commit/012438a2760b5bf89daa7e9b18848510f514d09c
DIFF: https://github.com/llvm/llvm-project/commit/012438a2760b5bf89daa7e9b18848510f514d09c.diff
LOG: Revert "[Passes] Expose parseSinglePassOption (#86117)"
This reverts commit 8cb2d436ca50117026a8dc901c8039d9bd39b507.
Added:
Modified:
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h
index d1232124d5d819..8817a2585646ca 100644
--- a/llvm/include/llvm/Passes/PassBuilder.h
+++ b/llvm/include/llvm/Passes/PassBuilder.h
@@ -672,13 +672,6 @@ class PassBuilder {
return Result;
}
- /// Handle passes only accept one bool-valued parameter.
- ///
- /// \return false when Params is empty.
- static Expected<bool> parseSinglePassOption(StringRef Params,
- StringRef OptionName,
- StringRef PassName);
-
private:
// O1 pass pipeline
FunctionPassManager
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index c5465da8b4a582..9d98ae7dde520f 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -600,9 +600,8 @@ Expected<LoopUnrollOptions> parseLoopUnrollOptions(StringRef Params) {
return UnrollOpts;
}
-Expected<bool> PassBuilder::parseSinglePassOption(StringRef Params,
- StringRef OptionName,
- StringRef PassName) {
+Expected<bool> parseSinglePassOption(StringRef Params, StringRef OptionName,
+ StringRef PassName) {
bool Result = false;
while (!Params.empty()) {
StringRef ParamName;
@@ -621,28 +620,24 @@ Expected<bool> PassBuilder::parseSinglePassOption(StringRef Params,
}
Expected<bool> parseGlobalDCEPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(
- Params, "vfe-linkage-unit-visibility", "GlobalDCE");
+ return parseSinglePassOption(Params, "vfe-linkage-unit-visibility", "GlobalDCE");
}
Expected<bool> parseCGProfilePassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "in-lto-post-link",
- "CGProfile");
+ return parseSinglePassOption(Params, "in-lto-post-link", "CGProfile");
}
Expected<bool> parseInlinerPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "only-mandatory",
- "InlinerPass");
+ return parseSinglePassOption(Params, "only-mandatory", "InlinerPass");
}
Expected<bool> parseCoroSplitPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "reuse-storage",
- "CoroSplitPass");
+ return parseSinglePassOption(Params, "reuse-storage", "CoroSplitPass");
}
Expected<bool> parsePostOrderFunctionAttrsPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(
- Params, "skip-non-recursive-function-attrs", "PostOrderFunctionAttrs");
+ return parseSinglePassOption(Params, "skip-non-recursive-function-attrs",
+ "PostOrderFunctionAttrs");
}
Expected<CFGuardPass::Mechanism> parseCFGuardPassOptions(StringRef Params) {
@@ -666,21 +661,19 @@ Expected<CFGuardPass::Mechanism> parseCFGuardPassOptions(StringRef Params) {
}
Expected<bool> parseEarlyCSEPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "memssa", "EarlyCSE");
+ return parseSinglePassOption(Params, "memssa", "EarlyCSE");
}
Expected<bool> parseEntryExitInstrumenterPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "post-inline",
- "EntryExitInstrumenter");
+ return parseSinglePassOption(Params, "post-inline", "EntryExitInstrumenter");
}
Expected<bool> parseLoopExtractorPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "single", "LoopExtractor");
+ return parseSinglePassOption(Params, "single", "LoopExtractor");
}
Expected<bool> parseLowerMatrixIntrinsicsPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "minimal",
- "LowerMatrixIntrinsics");
+ return parseSinglePassOption(Params, "minimal", "LowerMatrixIntrinsics");
}
Expected<AddressSanitizerOptions> parseASanPassOptions(StringRef Params) {
@@ -1020,13 +1013,13 @@ parseStackLifetimeOptions(StringRef Params) {
}
Expected<bool> parseDependenceAnalysisPrinterOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "normalized-results",
- "DependenceAnalysisPrinter");
+ return parseSinglePassOption(Params, "normalized-results",
+ "DependenceAnalysisPrinter");
}
Expected<bool> parseSeparateConstOffsetFromGEPPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "lower-gep",
- "SeparateConstOffsetFromGEP");
+ return parseSinglePassOption(Params, "lower-gep",
+ "SeparateConstOffsetFromGEP");
}
Expected<OptimizationLevel>
@@ -1042,13 +1035,13 @@ parseFunctionSimplificationPipelineOptions(StringRef Params) {
}
Expected<bool> parseMemorySSAPrinterPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "no-ensure-optimized-uses",
- "MemorySSAPrinterPass");
+ return parseSinglePassOption(Params, "no-ensure-optimized-uses",
+ "MemorySSAPrinterPass");
}
Expected<bool> parseSpeculativeExecutionPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "only-if-divergent-target",
- "SpeculativeExecutionPass");
+ return parseSinglePassOption(Params, "only-if-divergent-target",
+ "SpeculativeExecutionPass");
}
Expected<std::string> parseMemProfUsePassOptions(StringRef Params) {
@@ -1069,13 +1062,13 @@ Expected<std::string> parseMemProfUsePassOptions(StringRef Params) {
}
Expected<bool> parseStructuralHashPrinterPassOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "detailed",
- "StructuralHashPrinterPass");
+ return parseSinglePassOption(Params, "detailed",
+ "StructuralHashPrinterPass");
}
Expected<bool> parseWinEHPrepareOptions(StringRef Params) {
- return PassBuilder::parseSinglePassOption(Params, "demote-catchswitch-only",
- "WinEHPreparePass");
+ return parseSinglePassOption(Params, "demote-catchswitch-only",
+ "WinEHPreparePass");
}
Expected<GlobalMergeOptions> parseGlobalMergeOptions(StringRef Params) {
More information about the llvm-branch-commits
mailing list