[Attributor] Finalize the CGUpdater after each SCC
authorJohannes Doerfert <johannes@jdoerfert.de>
Sat, 10 Oct 2020 14:59:09 +0000 (09:59 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 28 Oct 2020 03:07:56 +0000 (22:07 -0500)
This matches the new PM model.

llvm/lib/Transforms/IPO/Attributor.cpp

index 81430f1..55eb42e 100644 (file)
@@ -2495,7 +2495,6 @@ struct AttributorLegacyPass : public ModulePass {
 };
 
 struct AttributorCGSCCLegacyPass : public CallGraphSCCPass {
-  CallGraphUpdater CGUpdater;
   static char ID;
 
   AttributorCGSCCLegacyPass() : CallGraphSCCPass(ID) {
@@ -2517,6 +2516,7 @@ struct AttributorCGSCCLegacyPass : public CallGraphSCCPass {
 
     AnalysisGetter AG;
     CallGraph &CG = const_cast<CallGraph &>(SCC.getCallGraph());
+    CallGraphUpdater CGUpdater;
     CGUpdater.initialize(CG, SCC);
     Module &M = *Functions.back()->getParent();
     BumpPtrAllocator Allocator;
@@ -2524,8 +2524,6 @@ struct AttributorCGSCCLegacyPass : public CallGraphSCCPass {
     return runAttributorOnFunctions(InfoCache, Functions, AG, CGUpdater);
   }
 
-  bool doFinalization(CallGraph &CG) override { return CGUpdater.finalize(); }
-
   void getAnalysisUsage(AnalysisUsage &AU) const override {
     // FIXME: Think about passes we will preserve and add them here.
     AU.addRequired<TargetLibraryInfoWrapperPass>();