[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass
authorArthur Eubanks <aeubanks@google.com>
Wed, 16 Sep 2020 20:49:31 +0000 (13:49 -0700)
committerArthur Eubanks <aeubanks@google.com>
Wed, 23 Sep 2020 22:22:18 +0000 (15:22 -0700)
commit6b1ce83a1238815899cf18f69bbc0eb37679a410
tree58f8a7d2b979e1c63c87dba01956f6ea90c52b22
parent6700b9de1637fd9888dfe9628157d2aeb6d9f526
[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass

This seems to fit the CGSCC updates model better than calling
addNewFunctionInto{Ref,}SCC() on newly created/outlined functions.
Now addNewFunctionInto{Ref,}SCC() are no longer necessary.

However, this doesn't work on newly outlined functions that aren't
referenced by the original function. e.g. if a() was outlined into b()
and c(), but c() is only referenced by b() and not by a(), this will
trigger an assert.

This also fixes an issue I was seeing with newly created functions not
having passes run on them.

Ran check-llvm with expensive checks.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87798
llvm/include/llvm/Analysis/LazyCallGraph.h
llvm/lib/Analysis/CGSCCPassManager.cpp
llvm/lib/Analysis/LazyCallGraph.cpp
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/lib/Transforms/Utils/CallGraphUpdater.cpp
llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
llvm/unittests/Analysis/LazyCallGraphTest.cpp