[AMDGPU] Preserve MachineDominatorTree in SILowerControlFlow
authorJay Foad <jay.foad@amd.com>
Thu, 7 Oct 2021 14:11:31 +0000 (15:11 +0100)
committerJay Foad <jay.foad@amd.com>
Thu, 7 Oct 2021 20:30:26 +0000 (21:30 +0100)
commite996cf7dce2c86d40fec263d82545dd363d9f445
tree919ff408244f360d7fc89404639c5c4376b0a7e9
parent097339b1cadcd6c24b607355db0f4c271d8ed261
[AMDGPU] Preserve MachineDominatorTree in SILowerControlFlow

Updating the MachineDominatorTree is easy since SILowerControlFlow only
splits and removes basic blocks. This should save a bit of compile time
because previously we would recompute the dominator tree from scratch
after this pass.

Another reason for doing this is that SILowerControlFlow preserves
LiveIntervals which transitively requires MachineDominatorTree. I think
that means that SILowerControlFlow is obliged to preserve
MachineDominatorTree too as explained here:
https://lists.llvm.org/pipermail/llvm-dev/2020-November/146923.html
although it does not seem to have caused any problems in practice yet.

Differential Revision: https://reviews.llvm.org/D111313
llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll