[PATCH] D91046: [CGSCC][Inliner] Handle new non-trivial edges in updateCGAndAnalysisManagerForPass

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 8 20:38:24 PST 2020


aeubanks created this revision.
aeubanks added reviewers: asbirlea, rnk.
Herald added subscribers: llvm-commits, hiraditya, eraman, Prazek.
Herald added a project: LLVM.
aeubanks requested review of this revision.

Previously the inliner did a bit of a hack by adding ref edges for all
new edges introduced by performing an inline before calling
updateCGAndAnalysisManagerForPass(). This was because
updateCGAndAnalysisManagerForPass() didn't handle new non-trivial call
edges.

This adds handling of non-trivial call edges to
updateCGAndAnalysisManagerForPass().  The inliner called
updateCGAndAnalysisManagerForFunctionPass() since it was handling adding
newly introduced edges (so updateCGAndAnalysisManagerForPass() would
only have to handle promotion), but now it needs to call
updateCGAndAnalysisManagerForCGSCCPass() since
updateCGAndAnalysisManagerForPass() is now handling the new call edges
and function passes cannot add new edges.

We follow the previous path of adding trivial ref edges then letting promotion
handle changing the ref edges to call edges and the CGSCC updates. So
this still does not allow adding call edges that result in an addition
of a non-trivial ref edge.

This is in preparation for better detecting devirtualization. Previously
since the inliner itself would add ref edges,
updateCGAndAnalysisManagerForPass() would think that promotion and thus
devirtualization had happened after any sort of inlining.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91046

Files:
  llvm/lib/Analysis/CGSCCPassManager.cpp
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/unittests/Analysis/CGSCCPassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91046.303748.patch
Type: text/x-patch
Size: 5888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201109/94ec47a5/attachment.bin>


More information about the llvm-commits mailing list