Lines Matching +full:auto +full:- +full:range

1 //===- HexagonBlockRanges.cpp ---------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
39 bool SbAE = (S < AE) || (S == AE && A.TiedEnd); // S-before-AE. in overlaps()
40 bool ASbE = (AS < E) || (AS == E && TiedEnd); // AS-before-E. in overlaps()
49 // Treat "None" in the range end as equal to the range start. in contains()
76 for (const auto &R : RL) in include()
90 while (Iter != end()-1) { in unionize()
94 bool Merge = MergeAdjacent && (Iter->end() == Next->start()); in unionize()
95 if (Merge || Iter->overlaps(*Next)) { in unionize()
96 Iter->merge(*Next); in unionize()
104 // Compute a range A-B and add it to the list.
107 // Exclusion of non-overlapping ranges makes some checks simpler in addsub()
110 // A - B = A. in addsub()
140 // Subtract a given range from each element in the list.
141 void HexagonBlockRanges::RangeList::subtract(const IndexRange &Range) { in subtract() argument
142 // Cannot assume that the list is unionized (i.e. contains only non- in subtract()
147 if (Rg.overlaps(Range)) { in subtract()
148 T.addsub(Rg, Range); in subtract()
149 Next = this->erase(I); in subtract()
161 for (auto &In : B) { in InstrIndexMap()
168 Last = B.empty() ? IndexType::None : unsigned(Idx)-1; in InstrIndexMap()
172 auto F = Map.find(Idx); in getInstr()
173 return (F != Map.end()) ? F->second : nullptr; in getInstr()
178 for (const auto &I : Map) in getIndex()
193 return unsigned(Idx)-1; in getPrevIndex()
208 for (auto &I : Map) { in replaceInstr()
223 // Consider all non-allocatable registers as reserved. in HexagonBlockRanges()
225 if (RC->isAllocatable()) in HexagonBlockRanges()
238 for (auto I : B.liveins()) { in getLiveIns()
251 for (auto R : Tmp) { in getLiveIns()
254 for (auto S : expandToSubRegs(R, MRI, TRI)) in getLiveIns()
278 auto &RC = *MRI.getRegClass(R.Reg); in expandToSubRegs()
294 MachineRegisterInfo &MRI = B.getParent()->getRegInfo(); in computeInitialLiveRanges()
296 for (auto R : getLiveIns(B, MRI, TRI)) in computeInitialLiveRanges()
299 for (auto R : LiveOnEntry) in computeInitialLiveRanges()
302 auto closeRange = [&LastUse,&LastDef,&LiveMap] (RegisterRef R) -> void { in computeInitialLiveRanges()
303 auto LD = LastDef[R], LU = LastUse[R]; in computeInitialLiveRanges()
314 for (auto &In : B) { in computeInitialLiveRanges()
319 for (auto &Op : In.operands()) { in computeInitialLiveRanges()
326 for (auto S : expandToSubRegs(R, MRI, TRI)) { in computeInitialLiveRanges()
335 for (auto &Op : In.operands()) { in computeInitialLiveRanges()
339 for (auto S : expandToSubRegs(R, MRI, TRI)) { in computeInitialLiveRanges()
349 for (auto &Op : In.operands()) { in computeInitialLiveRanges()
369 // dead %d0 = COPY %5, implicit-def %r0, implicit-def %r1 in computeInitialLiveRanges()
387 // Create a single-instruction range. in computeInitialLiveRanges()
393 // Collect live-on-exit. in computeInitialLiveRanges()
395 for (auto *SB : B.successors()) in computeInitialLiveRanges()
396 for (auto R : getLiveIns(*SB, MRI, TRI)) in computeInitialLiveRanges()
399 for (auto R : LiveOnExit) in computeInitialLiveRanges()
404 for (auto &I : LastUse) in computeInitialLiveRanges()
407 for (auto &I : LastDef) in computeInitialLiveRanges()
410 for (auto R : Left) in computeInitialLiveRanges()
414 for (auto &P : LiveMap) in computeInitialLiveRanges()
432 auto addDeadRanges = [&IndexMap,&LiveMap,&DeadMap] (RegisterRef R) -> void { in computeDeadMap()
433 auto F = LiveMap.find(R); in computeDeadMap()
434 if (F == LiveMap.end() || F->second.empty()) { in computeDeadMap()
439 RangeList &RL = F->second; in computeDeadMap()
440 RangeList::iterator A = RL.begin(), Z = RL.end()-1; in computeDeadMap()
442 // Try to create the initial range. in computeDeadMap()
443 if (A->start() != IndexType::Entry) { in computeDeadMap()
444 IndexType DE = IndexMap.getPrevIndex(A->start()); in computeDeadMap()
450 // Creating a dead range that follows A. Pay attention to empty in computeDeadMap()
452 IndexType AE = (A->end() == IndexType::None) ? A->start() : A->end(); in computeDeadMap()
455 IndexType DE = IndexMap.getPrevIndex(A->start()); in computeDeadMap()
460 // Try to create the final range. in computeDeadMap()
461 if (Z->end() != IndexType::Exit) { in computeDeadMap()
462 IndexType ZE = (Z->end() == IndexType::None) ? Z->start() : Z->end(); in computeDeadMap()
470 auto &MRI = MF.getRegInfo(); in computeDeadMap()
474 for (auto S : expandToSubRegs({R,0}, MRI, TRI)) { in computeDeadMap()
481 for (auto &P : LiveMap) in computeDeadMap()
493 return OS << '-'; in operator <<()
498 return OS << unsigned(Idx)-HexagonBlockRanges::IndexType::First+1; in operator <<()
512 for (const auto &R : RL) in operator <<()
519 for (auto &In : M.Block) { in operator <<()
528 for (const auto &I : P.Map) { in operator <<()
530 OS << printReg(I.first.Reg, &P.TRI, I.first.Sub) << " -> " << RL << "\n"; in operator <<()