[mlgo] Fix accounting for SCC splits
authorJin Xin Ng <njx@google.com>
Wed, 15 Jun 2022 17:38:48 +0000 (10:38 -0700)
committerMircea Trofin <mtrofin@google.com>
Wed, 15 Jun 2022 17:53:23 +0000 (10:53 -0700)
commitaaff3fb6d5c3a3617034cbd6b2d78fcbe7874d39
tree81e771c2e84ae9b3ed71d4903c7a0a5613acfe3d
parent5ff5b460d9fa67b7184dda86bc929b652d86acbc
[mlgo] Fix accounting for SCC splits

Previously if the inliner split an SCC such that an empty one remained, the MLInlineAdvisor could potentially lose track of the EdgeCount if a subsequent CGSCC pass modified the calls of a function that was initially in the SCC pre-split. Saving the seen nodes in onPassEntry resolves this.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D127693
llvm/include/llvm/Analysis/InlineAdvisor.h
llvm/include/llvm/Analysis/MLInlineAdvisor.h
llvm/lib/Analysis/MLInlineAdvisor.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/ML/scc-dead-accounting.ll [new file with mode: 0644]