Lines Matching refs:Segment
16 // individual segment is represented as an instance of LiveRange::Segment,
39 // segment collection.
59 typedef LiveRange::Segment Segment;
68 impl().insertAtEnd(Segment(Def, Def.getDeadSlot(), VNI));
72 Segment *S = segmentAt(I);
88 segments().insert(I, Segment(Def, Def.getDeadSlot(), VNI));
96 impl().findInsertPos(Segment(Use.getPrevSlot(), Use, nullptr));
107 /// This method is used when we want to extend the segment specified
112 assert(I != segments().end() && "Not a valid segment!");
113 Segment *S = segmentAt(I);
116 // Search for the first segment that we can't merge with.
121 // If NewEnd was in the middle of a segment, make sure to get its endpoint.
124 // If the newly formed segment now touches the segment after it and if they
125 // have the same value number, merge the two segments into one segment.
136 /// This method is used when we want to extend the segment specified
140 assert(I != segments().end() && "Not a valid segment!");
141 Segment *S = segmentAt(I);
144 // Search for the first segment that we can't merge with.
156 // If we start in the middle of another segment, just delete a range and
157 // extend that segment.
161 // Otherwise, extend the segment right after.
163 Segment *MergeToSeg = segmentAt(MergeTo);
172 iterator addSegment(Segment S) {
176 // If the inserted segment starts in the middle or right at the end of
177 // another segment, just extend that segment to contain the segment of S.
194 // Otherwise, if this segment ends in the middle of, or right next
195 // to, another segment, merge it into that segment.
201 // If S is a complete superset of a segment, we may need to grow its
215 // Otherwise, this is just a new segment that doesn't interact with
226 Segment *segmentAt(iterator I) { return const_cast<Segment *>(&(*I)); }
231 // based on a segment vector.
247 void insertAtEnd(const Segment &S) { LR->segments.push_back(S); }
251 iterator findInsertPos(Segment S) {
258 // based on a segment set.
275 void insertAtEnd(const Segment &S) {
281 LR->segmentSet->upper_bound(Segment(Pos, Pos.getNextSlot(), nullptr));
290 iterator findInsertPos(Segment S) {
325 // Use the segment set, if it is available.
328 // Otherwise use the segment vector.
445 for (const Segment &O : Other.segments) {
453 // Get next segment and abort if it was not adjacent.
480 for (const Segment &S : segments) {
484 assert(!VNI->isUnused() && "Unused valno used by live segment");
490 void LiveRange::addSegmentToSet(Segment S) {
494 LiveRange::iterator LiveRange::addSegment(Segment S) {
495 // Use the segment set, if it is available.
500 // Otherwise use the segment
504 void LiveRange::append(const Segment S) {
505 // Check that the segment belongs to the back of the list.
514 // Use the segment set, if it is available.
517 // Otherwise use the segment vector.
521 /// Remove the specified segment from this range. Note that the segment must
522 /// be in a single Segment in its entirety.
525 // Find the Segment containing this span.
527 assert(I != end() && "Segment is not in range!");
529 && "Segment is not entirely in range!");
531 // If the span we are removing is at the start of the Segment, adjust it.
549 segments.erase(I); // Removed the whole Segment.
555 // Otherwise if the span we are removing is at the end of the Segment,
562 // Otherwise, we are splitting the Segment into two pieces.
564 I->end = Start; // Trim the old segment.
567 segments.insert(std::next(I), Segment(End, OldEnd, ValNo));
574 segments.erase(std::remove_if(begin(), end(), [ValNo](const Segment &S) {
612 // and if they are neighbors, remove one Segment. This happens when we
617 // Didn't merge. Move OutIt to the next segment,
635 for (Segment &S : Other.segments)
656 for (Segment &S : Other.segments)
667 for (const Segment &S : RHS.segments)
680 for (const Segment &S : RHS.segments)
706 if (S->valno != V1) continue; // Not a V1 Segment.
745 assert(segmentSet != nullptr && "segment set must have been created");
748 "segment set can be used only initially before switching to the array");
762 // Start our search at the first segment that ends after the first slot.
772 // Go to the next segment that ends after the current slot.
778 // If this segment contains the slot, we're done.
784 // We didn't find a segment containing any of the slots.
822 for (const Segment &S : segments)
827 raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange::Segment &S) {
832 LLVM_DUMP_METHOD void LiveRange::Segment::dump() const {
841 for (const Segment &S : segments) {
992 static inline bool coalescable(const LiveRange::Segment &A,
993 const LiveRange::Segment &B) {
1003 void LiveRangeUpdater::add(LiveRange::Segment Seg) {
1007 // is using the segment set instead of the segment vector.
1041 // Check if the ReadI segment begins early.
1130 LR->segments.insert(ReadI, Spills.size() - GapSize, LiveRange::Segment());