diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -1632,8 +1632,12 @@ Functions.push_back(&N.getFunction()); } - if (deriveAttrsInPostOrder(Functions, AARGetter)) - return PreservedAnalyses::none(); + if (deriveAttrsInPostOrder(Functions, AARGetter)) { + // We have not changed the call graph or removed/added functions. + PreservedAnalyses PA; + PA.preserve(); + return PA; + } return PreservedAnalyses::all(); }