[llvm] [CodeGen] Use optimized domtree for MachineFunction (PR #102107)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 01:49:51 PDT 2024
================
@@ -364,13 +364,18 @@ bool MIRProfileLoaderPass::runOnMachineFunction(MachineFunction &MF) {
LLVM_DEBUG(dbgs() << "MIRProfileLoader pass working on Func: "
<< MF.getFunction().getName() << "\n");
MBFI = &getAnalysis<MachineBlockFrequencyInfoWrapperPass>().getMBFI();
+ auto *MDT = &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
+ auto *MPDT =
+ &getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
+
+ MF.RenumberBlocks();
+ MDT->updateBlockNumbers();
+ MPDT->updateBlockNumbers();
----------------
aengelke wrote:
I considered, but wanted to avoid the dependency of MachineFunction -> DomTree. Given that we would default-initialize these parameters to null, I also don't think that it makes mistakes less likely. Use of outdated numbers is guarded by an assertion.
https://github.com/llvm/llvm-project/pull/102107
More information about the llvm-commits
mailing list