[llvm] [CodeGen] Use optimized domtree for MachineFunction (PR #102107)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 01:44:07 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();
----------------
nikic wrote:
I'm wondering whether it makes sense to add DT/PDT arguments to RenumberBlocks directly, to make mistakes less likely?
https://github.com/llvm/llvm-project/pull/102107
More information about the llvm-commits
mailing list