[PATCH] D27983: Fix InlineSpiller accessing not updated dominator tree base information

Karl-Johan Karlsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 05:12:18 PST 2016


Ka-Ka added a comment.

In https://reviews.llvm.org/D27983#628114, @qcolombet wrote:

> Hi,
>
> The change looks good, but do you have a test case to add with it?
>
> Thanks,
> -Quentin


Unfortunately I'm not able to convert the reproducer we have in our out of tree backend to x86. The way split critical edges work by "caching" information in data structures (between different the passes) that is not a part of the IR make it hard to transform the reproducer to another backend as it must involve several passes. The reproducer I have in our out of tree backend work as following:

The PHIElimination pass introduce new basic blocks in PHIElimination::SplitPHIEdges(). The method MachineBasicBlock::SplitCriticalEdge() call MDT->recordSplitCriticalEdge() to update the dominator tree information, but it do not update the the dominator tree directly but instead store ("cache") the information for applying it later. Several passes execute and then when register allocator (RegAllocGreedy pass) execute InlineSpiller must access instructions in the newly introduced basic block from HoistSpillHelper::rmRedundantSpills(). The rmRedundantSpills() faulty access the dominator tree directly through the data member DT in the MachineDominatorTree (that will not apply the stored ("cached") information before the access).

To transform this reproducer to trigger the fault in another backend (x86) that have a totally different register set seems to be too tricky for me. I guess you have to either accept the changes without a testcase or leave the changes out.

Regards
/ Karl-Johan Karlsson


https://reviews.llvm.org/D27983





More information about the llvm-commits mailing list