[Dominators][CodeGen] Fix MachineDominatorTree preservation in PHIElimination

Authored by kuhar on Oct 1 2019, 11:27 AM.


[Dominators][CodeGen] Fix MachineDominatorTree preservation in PHIElimination

PHIElimination modifies CFG and marks MachineDominatorTree as preserved. Therefore, it the CFG changes it should also update the MDT, when available. This patch teaches PHIElimination to recalculate MDT when necessary.

This fixes the tailmerging_in_mbp.ll test failure discovered after switching to generic DomTree verification algorithm in MachineDominators in D67976.

Reviewers: arsenm, hliao, alex-t, rampitec, vpykhtin, grosser

Reviewed By: rampitec

Subscribers: MatzeB, wdng, hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68154

llvm-svn: 373377