Lines Matching refs:Segment
16 // individual segment is represented as an instance of LiveRange::Segment,
38 // segment collection.
58 typedef LiveRange::Segment Segment;
67 impl().insertAtEnd(Segment(Def, Def.getDeadSlot(), VNI));
71 Segment *S = segmentAt(I);
87 segments().insert(I, Segment(Def, Def.getDeadSlot(), VNI));
95 impl().findInsertPos(Segment(Use.getPrevSlot(), Use, nullptr));
106 /// This method is used when we want to extend the segment specified
111 assert(I != segments().end() && "Not a valid segment!");
112 Segment *S = segmentAt(I);
115 // Search for the first segment that we can't merge with.
120 // If NewEnd was in the middle of a segment, make sure to get its endpoint.
123 // If the newly formed segment now touches the segment after it and if they
124 // have the same value number, merge the two segments into one segment.
135 /// This method is used when we want to extend the segment specified
139 assert(I != segments().end() && "Not a valid segment!");
140 Segment *S = segmentAt(I);
143 // Search for the first segment that we can't merge with.
155 // If we start in the middle of another segment, just delete a range and
156 // extend that segment.
160 // Otherwise, extend the segment right after.
162 Segment *MergeToSeg = segmentAt(MergeTo);
171 iterator addSegment(Segment S) {
175 // If the inserted segment starts in the middle or right at the end of
176 // another segment, just extend that segment to contain the segment of S.
193 // Otherwise, if this segment ends in the middle of, or right next
194 // to, another segment, merge it into that segment.
200 // If S is a complete superset of a segment, we may need to grow its
214 // Otherwise, this is just a new segment that doesn't interact with
225 Segment *segmentAt(iterator I) { return const_cast<Segment *>(&(*I)); }
230 // based on a segment vector.
246 void insertAtEnd(const Segment &S) { LR->segments.push_back(S); }
250 iterator findInsertPos(Segment S) {
257 // based on a segment set.
274 void insertAtEnd(const Segment &S) {
280 LR->segmentSet->upper_bound(Segment(Pos, Pos.getNextSlot(), nullptr));
289 iterator findInsertPos(Segment S) {
322 // Use the segment set, if it is available.
325 // Otherwise use the segment vector.
442 for (const Segment &O : Other.segments) {
450 // Get next segment and abort if it was not adjacent.
477 for (const Segment &S : segments) {
481 assert(!VNI->isUnused() && "Unused valno used by live segment");
487 void LiveRange::addSegmentToSet(Segment S) {
491 LiveRange::iterator LiveRange::addSegment(Segment S) {
492 // Use the segment set, if it is available.
497 // Otherwise use the segment vector.
501 void LiveRange::append(const Segment S) {
502 // Check that the segment belongs to the back of the list.
511 // Use the segment set, if it is available.
514 // Otherwise use the segment vector.
518 /// Remove the specified segment from this range. Note that the segment must
519 /// be in a single Segment in its entirety.
522 // Find the Segment containing this span.
524 assert(I != end() && "Segment is not in range!");
526 && "Segment is not entirely in range!");
528 // If the span we are removing is at the start of the Segment, adjust it.
546 segments.erase(I); // Removed the whole Segment.
552 // Otherwise if the span we are removing is at the end of the Segment,
559 // Otherwise, we are splitting the Segment into two pieces.
561 I->end = Start; // Trim the old segment.
564 segments.insert(std::next(I), Segment(End, OldEnd, ValNo));
571 segments.erase(std::remove_if(begin(), end(), [ValNo](const Segment &S) {
609 // and if they are neighbors, remove one Segment. This happens when we
614 // Didn't merge. Move OutIt to the next segment,
632 for (Segment &S : Other.segments)
653 for (Segment &S : Other.segments)
664 for (const Segment &S : RHS.segments)
677 for (const Segment &S : RHS.segments)
703 if (S->valno != V1) continue; // Not a V1 Segment.
742 assert(segmentSet != nullptr && "segment set must have been created");
745 "segment set can be used only initially before switching to the array");
784 /// backwards until we find a place covered by a LiveRange segment that actually
795 LiveRange::Segment &S = *I;
822 LiveRange::Segment &S = *I;
839 // Merge with previous segment if it has the same VNI.
843 // Didn't merge. Move OutIt to next segment.
888 Segment CurrentSegment;
904 // Find the next begin or end of a subrange segment. Combine masks if we
910 // Advance iterator of subrange to a segment involving Pos; the earlier
948 // Finish previous segment because we have to start a new one.
954 // Start a new segment if necessary.
956 // Determine value number for the segment.
992 // Finish segment if no lane is active anymore.
1007 // block containing the definition comes after a segment using the valno.
1018 for (const Segment &S : segments)
1023 raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange::Segment &S) {
1028 void LiveRange::Segment::dump() const {
1037 for (const Segment &S : segments) {
1181 static inline bool coalescable(const LiveRange::Segment &A,
1182 const LiveRange::Segment &B) {
1192 void LiveRangeUpdater::add(LiveRange::Segment Seg) {
1196 // is using the segment set instead of the segment vector.
1230 // Check if the ReadI segment begins early.
1319 LR->segments.insert(ReadI, Spills.size() - GapSize, LiveRange::Segment());