Lines Matching full:segment

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