ReversePostOrderFunctionAttrs is not modifying the call graph, let's preserve it.
authorMehdi Amini <mehdi.amini@apple.com>
Mon, 2 May 2016 18:03:33 +0000 (18:03 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Mon, 2 May 2016 18:03:33 +0000 (18:03 +0000)
When running cc1 with -flto=thin, it is followed by GlobalOpt, which
requires the callgraph. This saves rebuilding one.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268266

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

index 91768f5..b6ebc63 100644 (file)
@@ -1153,6 +1153,7 @@ struct ReversePostOrderFunctionAttrs : public ModulePass {
   void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.setPreservesCFG();
     AU.addRequired<CallGraphWrapperPass>();
+    AU.addPreserved<CallGraphWrapperPass>();
   }
 };
 }