Go to the documentation of this file.
16 #ifndef LLVM_CODEGEN_LIVEINTERVALUNION_H
17 #define LLVM_CODEGEN_LIVEINTERVALUNION_H
29 class TargetRegisterInfo;
33 template <
unsigned Element>
class SparseBitVector;
76 bool empty()
const {
return Segments.empty(); }
85 unsigned getTag()
const {
return Tag; }
97 void clear() { Segments.clear(); ++Tag; }
118 bool CheckedFirstInterference =
false;
119 bool SeenAllInterferences =
false;
121 unsigned UserTag = 0;
125 unsigned collectInterferingVRegs(
unsigned MaxInterferingRegs);
128 bool isSeenInterference(
const LiveInterval *VirtReg)
const;
133 : LiveUnion(&LIU), LR(&LR) {}
139 LiveUnion = &NewLiveUnion;
141 InterferingVRegs.
clear();
142 CheckedFirstInterference =
false;
143 SeenAllInterferences =
false;
144 Tag = NewLiveUnion.
getTag();
145 UserTag = NewUserTag;
150 if (UserTag == NewUserTag && LR == &NewLR && LiveUnion == &NewLiveUnion &&
155 reset(NewUserTag, NewLR, NewLiveUnion);
164 if (!SeenAllInterferences || MaxInterferingRegs < InterferingVRegs.size())
165 collectInterferingVRegs(MaxInterferingRegs);
166 return InterferingVRegs;
183 unsigned size()
const {
return Size; }
188 assert(idx < Size &&
"idx out of bounds");
193 assert(Idx < Size &&
"Idx out of bounds");
201 #endif // LLVM_CODEGEN_LIVEINTERVALUNION_H
Query & operator=(const Query &)=delete
This is an optimization pass for GlobalISel generic memory operations.
LiveIntervalUnion(Allocator &a)
void reset(unsigned NewUserTag, const LiveRange &NewLR, const LiveIntervalUnion &NewLiveUnion)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Query(const LiveRange &LR, const LiveIntervalUnion &LIU)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void init(unsigned NewUserTag, const LiveRange &NewLR, const LiveIntervalUnion &NewLiveUnion)
const LiveInterval * getOneVReg() const
NDEBUG.
unsigned const TargetRegisterInfo * TRI
LiveSegments::Allocator Allocator
ConstSegmentIter end() const
=0.0 ? 0.0 :(a > 0.0 ? 1.0 :-1.0) a
SlotIndex startIndex() const
LiveSegments::const_iterator ConstSegmentIter
Const version of SegmentIter.
unsigned getTag() const
getTag - Return an opaque tag representing the current state of the union.
Segments::const_iterator const_iterator
const Map & getMap() const
bool changedSince(unsigned tag) const
changedSince - Return true if the union change since getTag returned tag.
ConstSegmentIter begin() const
This class implements an extremely fast bulk output stream that can only output to a stream.
LiveInterval - This class represents the liveness of a register, or stack slot.
SlotIndex - An opaque wrapper around machine indexes.
SlotIndex endIndex() const
SegmentIter find(SlotIndex x)
void print(raw_ostream &OS, const TargetRegisterInfo *TRI) const
typename Sizer::Allocator Allocator
void extract(const LiveInterval &VirtReg, const LiveRange &Range)
ConstSegmentIter find(SlotIndex x) const
LiveIntervalUnion & operator[](unsigned idx)
This class represents the liveness of a register, stack slot, etc.
Union of live intervals that are strong candidates for coalescing into a single register (either phys...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LiveSegments::iterator SegmentIter
void init(LiveIntervalUnion::Allocator &, unsigned Size)
const SmallVectorImpl< const LiveInterval * > & interferingVRegs(unsigned MaxInterferingRegs=std::numeric_limits< unsigned >::max())
const LiveIntervalUnion & operator[](unsigned Idx) const
void verify(LiveVirtRegBitSet &VisitedVRegs)
Query interferences between a single live virtual register and a live interval union.
void unify(const LiveInterval &VirtReg, const LiveRange &Range)
Align max(MaybeAlign Lhs, Align Rhs)
friend class const_iterator
This class consists of common code factored out of the SmallVector class to reduce code duplication b...