class SplitEditor
Declaration
class SplitEditor { /* full declaration omitted */ };
Description
SplitEditor - Edit machine code and LiveIntervals for live range splitting. - Create a SplitEditor from a SplitAnalysis. - Start a new live interval with openIntv. - Mark the places where the new interval is entered using enterIntv* - Mark the ranges where the new interval is used with useIntv* - Mark the places where the interval is exited with exitIntv*. - Finish the current interval with closeIntv and repeat from 2. - Rewrite instructions with finish().
Declared at: llvm/lib/CodeGen/SplitKit.h:257
Method Overview
- public SplitEditor(llvm::SplitAnalysis & sa, llvm::AliasAnalysis & aa, llvm::LiveIntervals & lis, llvm::VirtRegMap & vrm, llvm::MachineDominatorTree & mdt, llvm::MachineBlockFrequencyInfo & mbfi)
- public unsigned int currentIntv() const
- public void dump() const
- public llvm::SlotIndex enterIntvAfter(llvm::SlotIndex Idx)
- public llvm::SlotIndex enterIntvAtEnd(llvm::MachineBasicBlock & MBB)
- public llvm::SlotIndex enterIntvBefore(llvm::SlotIndex Idx)
- public void finish(SmallVectorImpl<unsigned int> * LRMap = nullptr)
- public llvm::SlotIndex leaveIntvAfter(llvm::SlotIndex Idx)
- public llvm::SlotIndex leaveIntvAtTop(llvm::MachineBasicBlock & MBB)
- public llvm::SlotIndex leaveIntvBefore(llvm::SlotIndex Idx)
- public unsigned int openIntv()
- public void overlapIntv(llvm::SlotIndex Start, llvm::SlotIndex End)
- public void reset(llvm::LiveRangeEdit &, llvm::SplitEditor::ComplementSpillMode = SM_Partition)
- public void selectIntv(unsigned int Idx)
- public void splitLiveThroughBlock(unsigned int MBBNum, unsigned int IntvIn, llvm::SlotIndex LeaveBefore, unsigned int IntvOut, llvm::SlotIndex EnterAfter)
- public void splitRegInBlock(const SplitAnalysis::BlockInfo & BI, unsigned int IntvIn, llvm::SlotIndex LeaveBefore)
- public void splitRegOutBlock(const SplitAnalysis::BlockInfo & BI, unsigned int IntvOut, llvm::SlotIndex EnterAfter)
- public void splitSingleBlock(const SplitAnalysis::BlockInfo & BI)
- public void useIntv(llvm::SlotIndex Start, llvm::SlotIndex End)
- public void useIntv(const llvm::MachineBasicBlock & MBB)
Methods
¶SplitEditor(llvm::SplitAnalysis& sa,
llvm::AliasAnalysis& aa,
llvm::LiveIntervals& lis,
llvm::VirtRegMap& vrm,
llvm::MachineDominatorTree& mdt,
llvm::MachineBlockFrequencyInfo& mbfi)
SplitEditor(llvm::SplitAnalysis& sa,
llvm::AliasAnalysis& aa,
llvm::LiveIntervals& lis,
llvm::VirtRegMap& vrm,
llvm::MachineDominatorTree& mdt,
llvm::MachineBlockFrequencyInfo& mbfi)
Description
Create a new SplitEditor for editing the LiveInterval analyzed by SA. Newly created intervals will be appended to newIntervals.
Declared at: llvm/lib/CodeGen/SplitKit.h:445
Parameters
- llvm::SplitAnalysis& sa
- llvm::AliasAnalysis& aa
- llvm::LiveIntervals& lis
- llvm::VirtRegMap& vrm
- llvm::MachineDominatorTree& mdt
- llvm::MachineBlockFrequencyInfo& mbfi
¶unsigned int currentIntv() const
unsigned int currentIntv() const
Description
currentIntv - Return the current interval index.
Declared at: llvm/lib/CodeGen/SplitKit.h:458
¶void dump() const
void dump() const
Description
dump - print the current interval mapping to dbgs().
Declared at: llvm/lib/CodeGen/SplitKit.h:516
¶llvm::SlotIndex enterIntvAfter(
llvm::SlotIndex Idx)
llvm::SlotIndex enterIntvAfter(
llvm::SlotIndex Idx)
Description
enterIntvAfter - Enter the open interval after the instruction at Idx. Return the beginning of the new live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:470
Parameters
- llvm::SlotIndex Idx
¶llvm::SlotIndex enterIntvAtEnd(
llvm::MachineBasicBlock& MBB)
llvm::SlotIndex enterIntvAtEnd(
llvm::MachineBasicBlock& MBB)
Description
enterIntvAtEnd - Enter the open interval at the end of MBB. Use the open interval from the inserted copy to the MBB end. Return the beginning of the new live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:475
Parameters
¶llvm::SlotIndex enterIntvBefore(
llvm::SlotIndex Idx)
llvm::SlotIndex enterIntvBefore(
llvm::SlotIndex Idx)
Description
enterIntvBefore - Enter the open interval before the instruction at Idx. If the parent interval is not live before Idx, a COPY is not inserted. Return the beginning of the new live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:466
Parameters
- llvm::SlotIndex Idx
¶void finish(SmallVectorImpl<unsigned int>* LRMap =
nullptr)
void finish(SmallVectorImpl<unsigned int>* LRMap =
nullptr)
Description
finish - after all the new live ranges have been created, compute the remaining live range, and rewrite instructions to use the new registers.
Declared at: llvm/lib/CodeGen/SplitKit.h:513
Parameters
- SmallVectorImpl<unsigned int>* LRMap = nullptr
- When not null, this vector will map each live range in Edit back to the indices returned by openIntv. There may be extra indices created by dead code elimination.
¶llvm::SlotIndex leaveIntvAfter(
llvm::SlotIndex Idx)
llvm::SlotIndex leaveIntvAfter(
llvm::SlotIndex Idx)
Description
leaveIntvAfter - Leave the open interval after the instruction at Idx. Return the end of the live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:485
Parameters
- llvm::SlotIndex Idx
¶llvm::SlotIndex leaveIntvAtTop(
llvm::MachineBasicBlock& MBB)
llvm::SlotIndex leaveIntvAtTop(
llvm::MachineBasicBlock& MBB)
Description
leaveIntvAtTop - Leave the interval at the top of MBB. Add liveness from the MBB top to the copy. Return the end of the live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:494
Parameters
¶llvm::SlotIndex leaveIntvBefore(
llvm::SlotIndex Idx)
llvm::SlotIndex leaveIntvBefore(
llvm::SlotIndex Idx)
Description
leaveIntvBefore - Leave the open interval before the instruction at Idx. Return the end of the live range.
Declared at: llvm/lib/CodeGen/SplitKit.h:489
Parameters
- llvm::SlotIndex Idx
¶unsigned int openIntv()
unsigned int openIntv()
Description
Create a new virtual register and live interval. Return the interval index, starting from 1. Interval index 0 is the implicit complement interval.
Declared at: llvm/lib/CodeGen/SplitKit.h:455
¶void overlapIntv(llvm::SlotIndex Start,
llvm::SlotIndex End)
void overlapIntv(llvm::SlotIndex Start,
llvm::SlotIndex End)
Description
overlapIntv - Indicate that all instructions in range should use the open interval, but also let the complement interval be live. This doubles the register pressure, but is sometimes required to deal with register uses after the last valid split point. The Start index should be a return value from a leaveIntv* call, and End should be in the same basic block. The parent interval must have the same value across the range.
Declared at: llvm/lib/CodeGen/SplitKit.h:506
Parameters
- llvm::SlotIndex Start
- llvm::SlotIndex End
¶void reset(
llvm::LiveRangeEdit&,
llvm::SplitEditor::ComplementSpillMode =
SM_Partition)
void reset(
llvm::LiveRangeEdit&,
llvm::SplitEditor::ComplementSpillMode =
SM_Partition)
Description
reset - Prepare for a new split.
Declared at: llvm/lib/CodeGen/SplitKit.h:450
Parameters
- llvm::LiveRangeEdit&
- llvm::SplitEditor::ComplementSpillMode = SM_Partition
¶void selectIntv(unsigned int Idx)
void selectIntv(unsigned int Idx)
Description
selectIntv - Select a previously opened interval index.
Declared at: llvm/lib/CodeGen/SplitKit.h:461
Parameters
- unsigned int Idx
¶void splitLiveThroughBlock(
unsigned int MBBNum,
unsigned int IntvIn,
llvm::SlotIndex LeaveBefore,
unsigned int IntvOut,
llvm::SlotIndex EnterAfter)
void splitLiveThroughBlock(
unsigned int MBBNum,
unsigned int IntvIn,
llvm::SlotIndex LeaveBefore,
unsigned int IntvOut,
llvm::SlotIndex EnterAfter)
Description
splitLiveThroughBlock - Split CurLI in the given block such that it enters the block in IntvIn and leaves it in IntvOut. There may be uses in the block, but they will be ignored when placing split points.
Declared at: llvm/lib/CodeGen/SplitKit.h:534
Parameters
- unsigned int MBBNum
- Block number.
- unsigned int IntvIn
- Interval index entering the block.
- llvm::SlotIndex LeaveBefore
- When set, leave IntvIn before this point.
- unsigned int IntvOut
- Interval index leaving the block.
- llvm::SlotIndex EnterAfter
- When set, enter IntvOut after this point.
¶void splitRegInBlock(
const SplitAnalysis::BlockInfo& BI,
unsigned int IntvIn,
llvm::SlotIndex LeaveBefore)
void splitRegInBlock(
const SplitAnalysis::BlockInfo& BI,
unsigned int IntvIn,
llvm::SlotIndex LeaveBefore)
Description
splitRegInBlock - Split CurLI in the given block such that it enters the block in IntvIn and leaves it on the stack (or not at all). Split points are placed in a way that avoids putting uses in the stack interval. This may require creating a local interval when there is interference.
Declared at: llvm/lib/CodeGen/SplitKit.h:546
Parameters
- const SplitAnalysis::BlockInfo& BI
- Block descriptor.
- unsigned int IntvIn
- Interval index entering the block. Not 0.
- llvm::SlotIndex LeaveBefore
- When set, leave IntvIn before this point.
¶void splitRegOutBlock(
const SplitAnalysis::BlockInfo& BI,
unsigned int IntvOut,
llvm::SlotIndex EnterAfter)
void splitRegOutBlock(
const SplitAnalysis::BlockInfo& BI,
unsigned int IntvOut,
llvm::SlotIndex EnterAfter)
Description
splitRegOutBlock - Split CurLI in the given block such that it enters the block on the stack (or isn't live-in at all) and leaves it in IntvOut. Split points are placed to avoid interference and such that the uses are not in the stack interval. This may require creating a local interval when there is interference.
Declared at: llvm/lib/CodeGen/SplitKit.h:558
Parameters
- const SplitAnalysis::BlockInfo& BI
- Block descriptor.
- unsigned int IntvOut
- Interval index leaving the block.
- llvm::SlotIndex EnterAfter
- When set, enter IntvOut after this point.
¶void splitSingleBlock(
const SplitAnalysis::BlockInfo& BI)
void splitSingleBlock(
const SplitAnalysis::BlockInfo& BI)
Description
splitSingleBlock - Split CurLI into a separate live interval around the uses in a single block. This is intended to be used as part of a larger split, and doesn't call finish().
Declared at: llvm/lib/CodeGen/SplitKit.h:523
Parameters
- const SplitAnalysis::BlockInfo& BI
¶void useIntv(llvm::SlotIndex Start,
llvm::SlotIndex End)
void useIntv(llvm::SlotIndex Start,
llvm::SlotIndex End)
Description
useIntv - indicate that all instructions in range should use OpenLI.
Declared at: llvm/lib/CodeGen/SplitKit.h:481
Parameters
- llvm::SlotIndex Start
- llvm::SlotIndex End
¶void useIntv(const llvm::MachineBasicBlock& MBB)
void useIntv(const llvm::MachineBasicBlock& MBB)
Description
useIntv - indicate that all instructions in MBB should use OpenLI.
Declared at: llvm/lib/CodeGen/SplitKit.h:478
Parameters
- const llvm::MachineBasicBlock& MBB