diff --git a/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp b/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp index 2cb184e8d4f492..b4f4006febec28 100644 --- a/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp @@ -88,9 +88,11 @@ static void addForcedAttributes(Function &F) { } } +static bool hasForceAttributes() { return !ForceAttributes.empty(); } + PreservedAnalyses ForceFunctionAttrsPass::run(Module &M, ModuleAnalysisManager &) { - if (ForceAttributes.empty()) + if (!hasForceAttributes()) return PreservedAnalyses::all(); for (Function &F : M.functions())