diff options
author | paperchalice <liujunchang97@outlook.com> | 2024-12-11 11:31:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 11:31:42 +0800 |
commit | 79047fac65b95a5a98bde0de473da858e805576c (patch) | |
tree | 6c2d968379f8da20c1c7af86b522876bab80f91e /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 30ea0f0ce476bf4c12684a9a514af2ca660bbe44 (diff) | |
download | llvm-79047fac65b95a5a98bde0de473da858e805576c.zip llvm-79047fac65b95a5a98bde0de473da858e805576c.tar.gz llvm-79047fac65b95a5a98bde0de473da858e805576c.tar.bz2 |
[DomTreeUpdater] Move critical edge splitting code to updater (#115111)
Support critical edge splitting in dominator tree updater. Continue the
work in #100856.
Compile time check:
https://llvm-compile-time-tracker.com/compare.php?from=87c35d782795b54911b3e3a91a5b738d4d870e55&to=42b3e5623a9ab4c3648564dc0926b36f3b438a3a&stat=instructions%3Au
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 5d06af3e..5ac6472 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -16,11 +16,13 @@ #include "llvm/CodeGen/LiveIntervals.h" #include "llvm/CodeGen/LivePhysRegs.h" #include "llvm/CodeGen/LiveVariables.h" +#include "llvm/CodeGen/MachineDomTreeUpdater.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineLoopInfo.h" +#include "llvm/CodeGen/MachinePostDominators.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SlotIndexes.h" #include "llvm/CodeGen/TargetInstrInfo.h" @@ -1146,7 +1148,7 @@ public: MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( MachineBasicBlock *Succ, Pass *P, MachineFunctionAnalysisManager *MFAM, - std::vector<SparseBitVector<>> *LiveInSets) { + std::vector<SparseBitVector<>> *LiveInSets, MachineDomTreeUpdater *MDTU) { assert((P || MFAM) && "Need a way to get analysis results!"); if (!canSplitCriticalEdge(Succ)) return nullptr; @@ -1346,8 +1348,8 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( LIS->repairIntervalsInRange(this, getFirstTerminator(), end(), UsedRegs); } - if (auto *MDT = GET_RESULT(MachineDominatorTree, getDomTree, )) - MDT->recordSplitCriticalEdge(this, Succ, NMBB); + if (MDTU) + MDTU->splitCriticalEdge(this, Succ, NMBB); if (MachineLoopInfo *MLI = GET_RESULT(MachineLoop, getLI, Info)) if (MachineLoop *TIL = MLI->getLoopFor(this)) { |