OSDN Git Service

[NFCI][Utils/Local] removeUnreachableBlocks(): cleanup support for lazy DomTreeUpdater
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 11 Jan 2021 21:29:55 +0000 (00:29 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 11 Jan 2021 23:09:47 +0000 (02:09 +0300)
commit90a92f8b4d783cb08443a22f0dd2fa3adcb43807
treeaf834f3b216b46c13619fe2717ffb7c170be0775
parentf9ba34770638389ee9b251f6ab801c7411601c77
[NFCI][Utils/Local] removeUnreachableBlocks(): cleanup support for lazy DomTreeUpdater

When DomTreeUpdater is in lazy update mode, the blocks
that were scheduled to be removed, won't be removed
until the updates are flushed, e.g. by asking
DomTreeUpdater for a up-to-date DomTree.

From the function's current code, it is pretty evident
that the support for the lazy mode is an afterthought,
see e.g. how we roll-back NumRemoved statistic..

So instead of considering all the unreachable blocks
as the blocks-to-be-removed, simply additionally skip
all the blocks that are already scheduled to be removed
llvm/lib/Transforms/Utils/Local.cpp