diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-10 22:01:05 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-10 22:01:05 +0000 |
commit | f235f13931835b3335f3f2ff2d3060381b93626c (patch) | |
tree | 3388d35b748a3c11118e4f20203141a6c76599e3 /lib/CodeGen/PHIElimination.h | |
parent | e35e3c33dc5533dd1e8ab7d9f4039cc1429d56aa (diff) |
Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.h')
-rw-r--r-- | lib/CodeGen/PHIElimination.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/PHIElimination.h b/lib/CodeGen/PHIElimination.h index 8a04f9d6ac..8188440c89 100644 --- a/lib/CodeGen/PHIElimination.h +++ b/lib/CodeGen/PHIElimination.h @@ -89,12 +89,21 @@ namespace llvm { /// void analyzePHINodes(const MachineFunction& Fn); + /// Split critical edges where necessary for good coalescer performance. + void SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB); + /// isLiveOut - Determine if Reg is live out from MBB, when not /// considering PHI nodes. This means that Reg is either killed by /// a successor block or passed through one. bool isLiveOut(unsigned Reg, const MachineBasicBlock &MBB, LiveVariables &LV); + /// SplitCriticalEdge - Split a critical edge from A to B by + /// inserting a new MBB. Update branches in A and PHI instructions + /// in B. Return the new block. + MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *A, + MachineBasicBlock *B); + // FindCopyInsertPoint - Find a safe place in MBB to insert a copy from // SrcReg. This needs to be after any def or uses of SrcReg, but before // any subsequent point where control flow might jump out of the basic |