Record correct dominators in merge return (#2760)
In merge return, we need to know the original dominator for a block in order to traverse code from the original dominator to the new dominator and add appropriate Phi nodes. The current code gets this wrong because the dominator tree is build as needed. The first time we get the immediate dominator for a function we just built the dominator tree and it takes into account that a block has been split. The second time it does not. This inconsistency needs to be fixed. We do that by recording the original dominator for all blocks at the start of the pass. If we were to record just the basic block, that could change if the block is split. We want to traverse the code in the body of the original dominator, whatever block it ends up in. To make this easy to track, we not save the terminator instruction to represent the original dominator. Fixes #2745
Loading
Please register or sign in to comment