Lines Matching defs:Seg
1190 void LiveRangeUpdater::add(LiveRange::Segment Seg) {
1196 LR->addSegmentToSet(Seg);
1201 if (!LastStart.isValid() || LastStart > Seg.start) {
1210 LastStart = Seg.start;
1212 // Advance ReadI until it ends after Seg.start.
1214 if (ReadI != E && ReadI->end <= Seg.start) {
1220 ReadI = WriteI = LR->find(Seg.start);
1222 while (ReadI != E && ReadI->end <= Seg.start)
1226 assert(ReadI == E || ReadI->end > Seg.start);
1229 if (ReadI != E && ReadI->start <= Seg.start) {
1230 assert(ReadI->valno == Seg.valno && "Cannot overlap different values");
1231 // Bail if Seg is completely contained in ReadI.
1232 if (ReadI->end >= Seg.end)
1234 // Coalesce into Seg.
1235 Seg.start = ReadI->start;
1239 // Coalesce as much as possible from ReadI into Seg.
1240 while (ReadI != E && coalescable(Seg, *ReadI)) {
1241 Seg.end = std::max(Seg.end, ReadI->end);
1245 // Try coalescing Spills.back() into Seg.
1246 if (!Spills.empty() && coalescable(Spills.back(), Seg)) {
1247 Seg.start = Spills.back().start;
1248 Seg.end = std::max(Spills.back().end, Seg.end);
1252 // Try coalescing Seg into WriteI[-1].
1253 if (WriteI != LR->begin() && coalescable(WriteI[-1], Seg)) {
1254 WriteI[-1].end = std::max(WriteI[-1].end, Seg.end);
1258 // Seg doesn't coalesce with anything, and needs to be inserted somewhere.
1260 *WriteI++ = Seg;
1266 LR->segments.push_back(Seg);
1269 Spills.push_back(Seg);