Lines Matching full:segment

15 // individual segment is represented as an instance of LiveRange::Segment,
53 // segment collection.
73 using Segment = LiveRange::Segment;
95 impl().insertAtEnd(Segment(Def, Def.getDeadSlot(), VNI));
99 Segment *S = segmentAt(I);
116 segments().insert(I, Segment(Def, Def.getDeadSlot(), VNI));
124 impl().findInsertPos(Segment(Use.getPrevSlot(), Use, nullptr));
140 iterator I = impl().findInsertPos(Segment(BeforeUse, Use, nullptr));
154 /// This method is used when we want to extend the segment specified
159 assert(I != segments().end() && "Not a valid segment!");
160 Segment *S = segmentAt(I);
163 // Search for the first segment that we can't merge with.
168 // If NewEnd was in the middle of a segment, make sure to get its endpoint.
171 // If the newly formed segment now touches the segment after it and if they
172 // have the same value number, merge the two segments into one segment.
183 /// This method is used when we want to extend the segment specified
187 assert(I != segments().end() && "Not a valid segment!");
188 Segment *S = segmentAt(I);
191 // Search for the first segment that we can't merge with.
203 // If we start in the middle of another segment, just delete a range and
204 // extend that segment.
208 // Otherwise, extend the segment right after.
210 Segment *MergeToSeg = segmentAt(MergeTo);
219 iterator addSegment(Segment S) {
223 // If the inserted segment starts in the middle or right at the end of
224 // another segment, just extend that segment to contain the segment of S.
241 // Otherwise, if this segment ends in the middle of, or right next
242 // to, another segment, merge it into that segment.
248 // If S is a complete superset of a segment, we may need to grow its
262 // Otherwise, this is just a new segment that doesn't interact with
273 Segment *segmentAt(iterator I) { return const_cast<Segment *>(&(*I)); }
278 // based on a segment vector.
295 void insertAtEnd(const Segment &S) { LR->segments.push_back(S); }
299 iterator findInsertPos(Segment S) { return llvm::upper_bound(*LR, S.start); }
304 // based on a segment set.
321 void insertAtEnd(const Segment &S) {
327 LR->segmentSet->upper_bound(Segment(Pos, Pos.getNextSlot(), nullptr));
336 iterator findInsertPos(Segment S) {
352 [&](const Segment &X) { return X.end <= Pos; });
356 // Use the segment set, if it is available.
359 // Otherwise use the segment vector.
364 // Use the segment set, if it is available.
367 // Otherwise use the segment vector.
484 for (const Segment &O : Other.segments) {
492 // Get next segment and abort if it was not adjacent.
519 for (const Segment &S : segments) {
523 assert(!VNI->isUnused() && "Unused valno used by live segment");
529 void LiveRange::addSegmentToSet(Segment S) {
533 LiveRange::iterator LiveRange::addSegment(Segment S) {
534 // Use the segment set, if it is available.
539 // Otherwise use the segment vector.
543 void LiveRange::append(const Segment S) {
544 // Check that the segment belongs to the back of the list.
551 // Use the segment set, if it is available.
554 // Otherwise use the segment vector.
559 // Use the segment set, if it is available.
562 // Otherwise use the segment vector.
568 // Find the Segment containing this span.
571 // No Segment found, so nothing to do.
576 && "Segment is not entirely in range!");
578 // If the span we are removing is at the start of the Segment, adjust it.
582 segments.erase(I); // Removed the whole Segment.
591 // Otherwise if the span we are removing is at the end of the Segment,
598 // Otherwise, we are splitting the Segment into two pieces.
600 I->end = Start; // Trim the old segment.
603 segments.insert(std::next(I), Segment(End, OldEnd, ValNo));
615 if (none_of(*this, [=](const Segment &S) { return S.valno == ValNo; }))
624 [ValNo](const Segment &S) { return S.valno == ValNo; });
661 // and if they are neighbors, remove one Segment. This happens when we
666 // Didn't merge. Move OutIt to the next segment,
684 for (Segment &S : Other.segments)
705 for (Segment &S : Other.segments)
716 for (const Segment &S : RHS.segments)
729 for (const Segment &S : RHS.segments)
755 if (S->valno != V1) continue; // Not a V1 Segment.
794 assert(segmentSet != nullptr && "segment set must have been created");
797 "segment set can be used only initially before switching to the array");
811 // Start our search at the first segment that ends after the first slot.
821 // Go to the next segment that ends after the current slot.
827 // If this segment contains the slot, we're done.
833 // We didn't find a segment containing any of the slots.
960 for (const Segment &S : segments)
989 raw_ostream& llvm::operator<<(raw_ostream& OS, const LiveRange::Segment &S) {
994 LLVM_DUMP_METHOD void LiveRange::Segment::dump() const {
1003 for (const Segment &S : segments) {
1157 static inline bool coalescable(const LiveRange::Segment &A,
1158 const LiveRange::Segment &B) {
1168 void LiveRangeUpdater::add(LiveRange::Segment Seg) {
1172 // is using the segment set instead of the segment vector.
1206 // Check if the ReadI segment begins early.
1295 LR->segments.insert(ReadI, Spills.size() - GapSize, LiveRange::Segment());