[PATCH] D35304: [RuntimeLoopUnrolling] Update DomTree correctly when exit blocks have successors

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 14:17:29 PDT 2017


anna added a comment.

Hi Michael,

In https://reviews.llvm.org/D35304#807108, @mzolotukhin wrote:

> Don't we break critical edges before unrolling? If so, then I think this situation should never happen (and if it does, we need to understand why).
>
> Michael


As part of support for  runtime unrolling in presence of multiple exit blocks (functionality was added in https://reviews.llvm.org/rL306846), when we have multiple exits in a loop, we generate edges from both the main loop and the remainder loop to the main loop's exit block (this is the structure after `cloneLoopBlocks`). This was to avoid cloning of these multiple exit blocks. After this is done, there are three cleanup steps done:

1. update the phi nodes in the exit blocks.
2. update the immediate dominator of these exit blocks
3. preserve the `hasDedicatedExits` property for both main and remainder loop: see lines 848-856.

Does this answer your question? Thanks.


https://reviews.llvm.org/D35304





More information about the llvm-commits mailing list