15 #ifndef LLVM_CODEGEN_SPLITKIT_H
16 #define LLVM_CODEGEN_SPLITKIT_H
26 class ConnectedVNInfoEqClasses;
30 class MachineBlockFrequencyInfo;
32 class MachineLoopInfo;
33 class MachineRegisterInfo;
34 class TargetInstrInfo;
35 class TargetRegisterInfo;
100 unsigned NumGapBlocks;
106 unsigned NumThroughBlocks;
111 SlotIndex computeLastSplitPoint(
unsigned Num);
117 bool calcLiveBlockInfo();
143 if (LastSplitPoint[Num].first.isValid() &&
144 !LastSplitPoint[Num].second.isValid())
145 return LastSplitPoint[Num].first;
146 return computeLastSplitPoint(Num);
271 RegAssignMap RegAssign;
299 return LRCalc[SpillMode !=
SM_Partition && RegIdx != 0];
307 VNInfo *defValue(
unsigned RegIdx,
const VNInfo *ParentVNI, SlotIndex Idx);
313 void forceRecompute(
unsigned RegIdx,
const VNInfo *ParentVNI);
317 VNInfo *defFromParent(
unsigned RegIdx,
320 MachineBasicBlock &MBB,
325 void removeBackCopies(SmallVectorImpl<VNInfo*> &Copies);
329 MachineBasicBlock *findShallowDominator(MachineBasicBlock *MBB,
330 MachineBasicBlock *DefMBB);
334 void hoistCopiesForSize();
338 bool transferValues();
342 void extendPHIKillRanges();
345 void rewriteAssigned(
bool ExtendRanges);
348 void deleteRematVictims();
353 SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&,
354 MachineDominatorTree&, MachineBlockFrequencyInfo &);
const LiveInterval & getParent() const
getParent - Return the last analyzed interval.
void reset(LiveRangeEdit &, ComplementSpillMode=SM_Partition)
reset - Prepare for a new split.
SlotIndex getLastSplitPoint(unsigned Num)
const BitVector & getThroughBlocks() const
getThroughBlocks - Return the set of through blocks.
void finish(SmallVectorImpl< unsigned > *LRMap=0)
SplitEditor(SplitAnalysis &SA, LiveIntervals &, VirtRegMap &, MachineDominatorTree &, MachineBlockFrequencyInfo &)
Create a new SplitEditor for editing the LiveInterval analyzed by SA.
SlotIndex FirstDef
First non-phi valno->def, or SlotIndex().
const MachineLoopInfo & Loops
SplitAnalysis(const VirtRegMap &vrm, const LiveIntervals &lis, const MachineLoopInfo &mli)
SlotIndex enterIntvAtEnd(MachineBasicBlock &MBB)
void splitRegInBlock(const SplitAnalysis::BlockInfo &BI, unsigned IntvIn, SlotIndex LeaveBefore)
void analyze(const LiveInterval *li)
void splitSingleBlock(const SplitAnalysis::BlockInfo &BI)
const TargetInstrInfo & TII
void overlapIntv(SlotIndex Start, SlotIndex End)
unsigned getNumThroughBlocks() const
getNumThroughBlocks - Return the number of through blocks.
bool didRepairRange() const
unsigned openIntv()
Create a new virtual register and live interval.
bool shouldSplitSingleBlock(const BlockInfo &BI, bool SingleInstrs) const
SlotIndex leaveIntvAfter(SlotIndex Idx)
MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *)
getLastSplitPointIter - Returns the last split point as an iterator.
const LiveIntervals & LIS
ArrayRef< SlotIndex > getUseSlots() const
unsigned currentIntv() const
currentIntv - Return the current interval index.
SlotIndex LastInstr
Last instr accessing current reg.
bundle_iterator< MachineInstr, instr_iterator > iterator
void useIntv(const MachineBasicBlock &MBB)
useIntv - indicate that all instructions in MBB should use OpenLI.
SlotIndex leaveIntvAtTop(MachineBasicBlock &MBB)
void selectIntv(unsigned Idx)
selectIntv - Select a previously opened interval index.
void splitRegOutBlock(const SplitAnalysis::BlockInfo &BI, unsigned IntvOut, SlotIndex EnterAfter)
static bool isSameInstr(SlotIndex A, SlotIndex B)
isSameInstr - Return true if A and B refer to the same instruction.
const MachineFunction & MF
unsigned getNumLiveBlocks() const
getNumLiveBlocks - Return the number of blocks where CurLI is live.
SlotIndex FirstInstr
First instr accessing current reg.
SlotIndex leaveIntvBefore(SlotIndex Idx)
bool test(unsigned Idx) const
ArrayRef< BlockInfo > getUseBlocks() const
bool LiveOut
Current reg is live out.
void splitLiveThroughBlock(unsigned MBBNum, unsigned IntvIn, SlotIndex LeaveBefore, unsigned IntvOut, SlotIndex EnterAfter)
SmallPtrSet< const MachineBasicBlock *, 16 > BlockPtrSet
Sizer::Allocator Allocator
SlotIndex enterIntvBefore(SlotIndex Idx)
unsigned countLiveBlocks(const LiveInterval *li) const
SlotIndex enterIntvAfter(SlotIndex Idx)
bool isThroughBlock(unsigned MBB) const
isThroughBlock - Return true if CurLI is live through MBB without uses.
bool LiveIn
Current reg is live in.
SlotIndex - An opaque wrapper around machine indexes.
void dump() const
dump - print the current interval maping to dbgs().
bool isOriginalEndpoint(SlotIndex Idx) const