diff --git a/include/llvm/Support/StandardPasses.h b/include/llvm/Support/StandardPasses.h index 6a79b5d0fd3..a5394445a19 100644 --- a/include/llvm/Support/StandardPasses.h +++ b/include/llvm/Support/StandardPasses.h @@ -107,13 +107,12 @@ namespace llvm { PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE // Start of CallGraph SCC passes. - if (UnitAtATime) { - if (HaveExceptions) - PM->add(createPruneEHPass()); // Remove dead EH info - PM->add(createFunctionAttrsPass()); // Set readonly/readnone attrs - } + if (UnitAtATime && HaveExceptions) + PM->add(createPruneEHPass()); // Remove dead EH info if (InliningPass) PM->add(InliningPass); + if (UnitAtATime) + PM->add(createFunctionAttrsPass()); // Set readonly/readnone attrs if (OptimizationLevel > 2) PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args