diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-22 17:25:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-22 17:25:57 +0000 |
commit | 853d3fb8d24fab2258e9cd5dce3ec8ff4189eeda (patch) | |
tree | 5fefc9df2fa37f7a1e449259a14ed900513c854f /include/llvm/CodeGen/MachineBasicBlock.h | |
parent | 6ff1c3f36c53d37097d1e66b58cd8d129d690127 (diff) |
Move PHIElimination's SplitCriticalEdge for MachineBasicBlocks out
into a utility routine, teach it how to update MachineLoopInfo, and
make use of it in MachineLICM to split critical edges on demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index cc651ca77b..82f9c0f25f 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -19,6 +19,7 @@ namespace llvm { +class Pass; class BasicBlock; class MachineFunction; class MCSymbol; @@ -281,6 +282,14 @@ public: /// it returns end() iterator getFirstTerminator(); + /// SplitCriticalEdge - Split the critical edge from this block to the + /// given successor block, and return the newly created block, or null + /// if splitting is not possible. + /// + /// This function updates LiveVariables, MachineDominatorTree, and + /// MachineLoopInfo, as applicable. + MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P); + void pop_front() { Insts.pop_front(); } void pop_back() { Insts.pop_back(); } void push_back(MachineInstr *MI) { Insts.push_back(MI); } |