diff options
| author | Arthur Eubanks <aeubanks@google.com> | 2020-12-07 23:14:49 -0800 |
|---|---|---|
| committer | Arthur Eubanks <aeubanks@google.com> | 2020-12-08 13:38:56 -0800 |
| commit | eca13e995c6428e11f0d402641a74c9fe26f124c (patch) | |
| tree | 14d7888605f45efb116ee9be4c8e994c945732e8 | |
| parent | 95ea50e4adf76b75fcc0ad29cacd10642db091a6 (diff) | |
| download | llvm-eca13e995c6428e11f0d402641a74c9fe26f124c.zip llvm-eca13e995c6428e11f0d402641a74c9fe26f124c.tar.gz llvm-eca13e995c6428e11f0d402641a74c9fe26f124c.tar.bz2 | |
[NFC] Rename IsCodeGenPass to ShouldPinPassToLegacyPM
Codegen-specific passes are being ported to the NPM. Rename for better
clarity and note that ported passes that fully work with the NPM should
be removed from these lists.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D92818
| -rw-r--r-- | llvm/tools/opt/opt.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index ed50c0c..5e64178 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -457,10 +457,11 @@ struct TimeTracerRAII { } }; -// For use in NPM transition. +// For use in NPM transition. Currently this contains most codegen-specific +// passes. Remove passes from here when porting to the NPM. // TODO: use a codegen version of PassRegistry.def/PassBuilder::is*Pass() once // it exists. -static bool IsCodegenPass(StringRef Pass) { +static bool shouldPinPassToLegacyPM(StringRef Pass) { std::vector<StringRef> PassNamePrefix = { "x86-", "xcore-", "wasm-", "systemz-", "ppc-", "nvvm-", "nvptx-", "mips-", "lanai-", "hexagon-", "bpf-", "avr-", "thumb2-", "arm-", @@ -490,10 +491,10 @@ static bool IsCodegenPass(StringRef Pass) { } // For use in NPM transition. -static bool CodegenPassSpecifiedInPassList() { +static bool shouldForceLegacyPM() { for (const auto &P : PassList) { StringRef Arg = P->getPassArgument(); - if (IsCodegenPass(Arg)) + if (shouldPinPassToLegacyPM(Arg)) return true; } return false; @@ -722,7 +723,7 @@ int main(int argc, char **argv) { // If `-enable-new-pm` is specified and there are no codegen passes, use NPM. // e.g. `-enable-new-pm -sroa` will use NPM. // but `-enable-new-pm -codegenprepare` will still revert to legacy PM. - if ((EnableNewPassManager && !CodegenPassSpecifiedInPassList()) || + if ((EnableNewPassManager && !shouldForceLegacyPM()) || PassPipeline.getNumOccurrences() > 0) { if (AnalyzeOnly) { errs() << "Cannot specify -analyze under new pass manager\n"; |
