@@ -692,6 +692,9 @@ void PassRunner::run() {
692692 assert (!ran);
693693 ran = true ;
694694
695+ // As we run passes, we'll notice which we skip.
696+ skippedPasses.clear ();
697+
695698 static const int passDebug = getPassDebug ();
696699 // Emit logging information when asked for. At passDebug level 1+ we log
697700 // the main passes, while in 2 we also log nested ones. Note that for
@@ -812,6 +815,16 @@ void PassRunner::run() {
812815 }
813816 flush ();
814817 }
818+
819+ // All the passes the user requested to skip should have been seen, and
820+ // skipped. If not, the user may have had a typo in the name of a pass to
821+ // skip, and we will warn.
822+ for (auto pass : options.passesToSkip ) {
823+ if (!skippedPasses.count (pass)) {
824+ std::cerr << " warning: --" << pass << " was requested to be skipped, "
825+ << " but it was not found in the passes that were run.\n " ;
826+ }
827+ }
815828}
816829
817830void PassRunner::runOnFunction (Function* func) {
@@ -930,6 +943,13 @@ struct AfterEffectModuleChecker {
930943};
931944
932945void PassRunner::runPass (Pass* pass) {
946+ assert (!pass->isFunctionParallel ());
947+
948+ if (options.passesToSkip .count (pass->name )) {
949+ skippedPasses.insert (pass->name );
950+ return ;
951+ }
952+
933953 std::unique_ptr<AfterEffectModuleChecker> checker;
934954 if (getPassDebug ()) {
935955 checker = std::unique_ptr<AfterEffectModuleChecker>(
@@ -949,6 +969,11 @@ void PassRunner::runPass(Pass* pass) {
949969void PassRunner::runPassOnFunction (Pass* pass, Function* func) {
950970 assert (pass->isFunctionParallel ());
951971
972+ if (options.passesToSkip .count (pass->name )) {
973+ skippedPasses.insert (pass->name );
974+ return ;
975+ }
976+
952977 auto passDebug = getPassDebug ();
953978
954979 // Add extra validation logic in pass-debug mode 2. The main logic in
0 commit comments