diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -341,6 +341,7 @@ LOOP_PASS("print", LoopCachePrinterPass(dbgs())) LOOP_PASS("loop-predication", LoopPredicationPass()) LOOP_PASS("guard-widening", GuardWideningPass()) +LOOP_PASS("simple-loop-unswitch", SimpleLoopUnswitchPass()) #undef LOOP_PASS #ifndef LOOP_PASS_WITH_PARAMS diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -738,7 +738,7 @@ if (OutputThinLTOBC) M->addModuleFlag(Module::Error, "EnableSplitLTOUnit", SplitLTOUnit); - if (EnableNewPassManager || PassPipeline.getNumOccurrences() > 0) { + if (!EnableNewPassManager || PassPipeline.getNumOccurrences() > 0) { if (PassPipeline.getNumOccurrences() > 0 && PassList.size() > 0) { errs() << "Cannot specify passes via both -foo-pass and --passes=foo-pass";