15 #ifndef LLVM_LIB_CODEGEN_SPLITKIT_H
16 #define LLVM_LIB_CODEGEN_SPLITKIT_H
27 class ConnectedVNInfoEqClasses;
31 class MachineBlockFrequencyInfo;
33 class MachineLoopInfo;
34 class MachineRegisterInfo;
35 class TargetInstrInfo;
36 class TargetRegisterInfo;
64 if (LastInsertPoint[Num].first.isValid() &&
65 !LastInsertPoint[Num].second.isValid())
66 return LastInsertPoint[Num].first;
67 return computeLastInsertPoint(CurLI, MBB);
132 unsigned NumGapBlocks;
138 unsigned NumThroughBlocks;
147 bool calcLiveBlockInfo();
174 bool isOriginalEndpoint(
SlotIndex Idx)
const;
195 return getUseBlocks().size() - NumGapBlocks + getNumThroughBlocks();
213 bool shouldSplitSingleBlock(
const BlockInfo &BI,
bool SingleInstrs)
const;
216 return IPA.getLastInsertPoint(*CurLI, *MF.getBlockNumbered(Num));
220 return IPA.getLastInsertPointIter(*CurLI, *BB);
286 ComplementSpillMode SpillMode;
297 RegAssignMap RegAssign;
325 return LRCalc[SpillMode != SM_Partition && RegIdx != 0];
332 LiveInterval::SubRange &getSubRangeForMask(LaneBitmask LM, LiveInterval &LI);
340 void addDeadDef(LiveInterval &LI, VNInfo *VNI,
bool Original);
350 VNInfo *defValue(
unsigned RegIdx,
const VNInfo *ParentVNI, SlotIndex Idx,
357 void forceRecompute(
unsigned RegIdx,
const VNInfo *ParentVNI);
361 VNInfo *defFromParent(
unsigned RegIdx,
364 MachineBasicBlock &
MBB,
369 void removeBackCopies(SmallVectorImpl<VNInfo*> &Copies);
373 MachineBasicBlock *findShallowDominator(MachineBasicBlock *
MBB,
374 MachineBasicBlock *DefMBB);
377 void computeRedundantBackCopies(DenseSet<unsigned> &NotToHoistSet,
378 SmallVectorImpl<VNInfo *> &BackCopies);
387 bool transferValues();
394 void extendPHIRange(MachineBasicBlock &
B, LiveRangeCalc &LRC,
395 LiveRange &LR, LaneBitmask LM,
396 ArrayRef<SlotIndex> Undefs);
400 void extendPHIKillRanges();
403 void rewriteAssigned(
bool ExtendRanges);
406 void deleteRematVictims();
411 SplitEditor(SplitAnalysis &SA,
AliasAnalysis &AA, LiveIntervals&,
412 VirtRegMap&, MachineDominatorTree&,
413 MachineBlockFrequencyInfo &);
416 void reset(LiveRangeEdit&, ComplementSpillMode = SM_Partition);
427 void selectIntv(
unsigned Idx);
500 void splitLiveThroughBlock(
unsigned MBBNum,
const LiveInterval & getParent() const
getParent - Return the last analyzed interval.
AAResults AliasAnalysis
Temporary typedef for legacy code that uses a generic AliasAnalysis pointer or reference.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
SlotIndex getLastSplitPoint(unsigned Num)
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.
MachineInstrBundleIterator< MachineInstr > iterator
Determines the latest safe point in a block in which we can insert a split, spill or other instructio...
const HexagonInstrInfo * TII
const TargetInstrInfo & TII
SlotIndex getLastInsertPoint(const LiveInterval &CurLI, const MachineBasicBlock &MBB)
Return the base index of the last valid insert point for in .
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)...
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
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.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
bool isOneInstr() const
isOneInstr - Returns true when this BlockInfo describes a single instruction.
unsigned const MachineRegisterInfo * MRI
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...
SM_Size - Overlap intervals to minimize the number of inserted COPY instructions. ...
Greedy Register Allocator
static const unsigned End
#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...
MachineBasicBlock::iterator getLastSplitPointIter(MachineBasicBlock *BB)
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.
static void clear(coro::Shape &Shape)
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...