15 #ifndef LLVM_LIB_CODEGEN_SPLITKIT_H
16 #define LLVM_LIB_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);
157 bool isOriginalEndpoint(
SlotIndex Idx)
const;
178 return getUseBlocks().size() - NumGapBlocks + getNumThroughBlocks();
196 bool shouldSplitSingleBlock(
const BlockInfo &BI,
bool SingleInstrs)
const;
260 ComplementSpillMode SpillMode;
266 RegAssignMap::Allocator Allocator;
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 &);
357 void reset(LiveRangeEdit&, ComplementSpillMode = SM_Partition);
368 void selectIntv(
unsigned Idx);
441 void splitLiveThroughBlock(
unsigned MBBNum,
const LiveInterval & getParent() const
getParent - Return the last analyzed interval.
SlotIndex getLastSplitPoint(unsigned Num)
getLastSplitPoint - Return the base index of the last valid split point in the basic block numbered N...
const BitVector & getThroughBlocks() const
getThroughBlocks - Return the set of through blocks.
LiveInterval - This class represents the liveness of a register, or stack slot.
SlotIndex FirstDef
First non-phi valno->def, or SlotIndex().
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
const MachineLoopInfo & Loops
ComplementSpillMode
ComplementSpillMode - Select how the complement live range should be created.
const HexagonInstrInfo * TII
const TargetInstrInfo & TII
unsigned getNumThroughBlocks() const
getNumThroughBlocks - Return the number of through blocks.
bool didRepairRange() const
didRepairRange() - Returns true if CurLI was invalid and has been repaired by analyze().
SplitEditor - Edit machine code and LiveIntervals for live range splitting.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const LiveIntervals & LIS
ArrayRef< SlotIndex > getUseSlots() const
getUseSlots - Return an array of SlotIndexes of instructions using CurLI.
unsigned currentIntv() const
currentIntv - Return the current interval index.
SlotIndex LastInstr
Last instr accessing current reg.
TargetInstrInfo - Interface to description of machine instruction set.
bundle_iterator< MachineInstr, instr_iterator > iterator
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
bool isOneInstr() const
isOneInstr - Returns true when this BlockInfo describes a single instruction.
PointerIntPair - This class implements a pair of a pointer and small integer.
SM_Partition(Default) - Try to create the complement interval so it doesn't overlap any other interva...
bundle_iterator - MachineBasicBlock iterator that automatically skips over MIs that are inside bundle...
SM_Size - Overlap intervals to minimize the number of inserted COPY instructions. ...
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
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.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Additional information about basic blocks where the current variable is live.
SplitAnalysis - Analyze a LiveInterval, looking for live range splitting opportunities.
ArrayRef< BlockInfo > getUseBlocks() const
getUseBlocks - Return an array of BlockInfo objects for the basic blocks where CurLI has uses...
bool LiveOut
Current reg is live out.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
SmallPtrSet< const MachineBasicBlock *, 16 > BlockPtrSet
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.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...