[PM] keeping history when original SCC split and then merge into itself
authorWei Mi <wmi@google.com>
Tue, 23 Oct 2018 23:29:45 +0000 (23:29 +0000)
committerWei Mi <wmi@google.com>
Tue, 23 Oct 2018 23:29:45 +0000 (23:29 +0000)
commit80a0c97e07bd2057e163ec3e53702e458803a03b
tree299ee87691d2a246e474d8574fac6210f2917ad7
parent4f82406c460d7b302fed395464d6649dc6aea05e
[PM] keeping history when original SCC split and then merge into itself
in the same round of SCC update.

In https://reviews.llvm.org/rL309784, inline history is added to prevent
infinite inlining across multiple run of inliner and SCC update, but the
history will only be kept when new SCC is actually generated during SCC update.

We found a case that SCC can be split and then merge into itself in the same
round of SCC update, so the same SCC will be pop out from UR.CWorklist and
then added back immediately, without any new SCC generated, that is why the
existing patch cannot catch the infinite inline case.

What the patch does is even if no new SCC is generated, if only the current
SCC appears in UR.CWorklist again, then keep the inline history.

Differential Revision: https://reviews.llvm.org/D52915

llvm-svn: 345103
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/cgscc-cycle.ll
llvm/test/Transforms/Inline/monster_scc.ll