I am not sure whether this is the right approach, just send it out to get comments and improve it on the way.
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 case.
The patch changes the condition when inline history should be kept. If only UR.CWorklist has ever increased after SCC update, it means split has happen and we should keep the inline history to prevent infinite loop.