Lines Matching +full:numbering +full:- +full:space

1 //===-- SlotIndexes.cpp - Slot Indexes Pass  ------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 #include "llvm/Config/llvm-config.h"
47 INITIALIZE_PASS(SlotIndexesWrapperPass, DEBUG_TYPE, "Slot index numbering",
67 // Compute numbering as follows: in analyze()
70 // iterator in lock-step (though skipping it over indexes which have in analyze()
76 // only need to be set up once after the first numbering is computed. in analyze()
81 assert(indexList.empty() && "Index list non-empty at initial numbering?"); in analyze()
83 "Index -> MBB mapping non-empty at initial numbering?"); in analyze()
85 "MBB -> Index mapping non-empty at initial numbering?"); in analyze()
87 "MachineInstr -> Index mapping non-empty at initial numbering?"); in analyze()
90 MBBRanges.resize(mf->getNumBlockIDs()); in analyze()
91 idx2MBBMap.reserve(mf->size()); in analyze()
124 LLVM_DEBUG(mf->print(dbgs(), this)); in analyze()
135 SlotIndex MIIndex = mi2iItr->second; in removeMachineInstrFromMaps()
148 SlotIndex MIIndex = mi2iItr->second; in removeSingleMachineInstrFromMaps()
174 const unsigned Space = SlotIndex::InstrDist/2; in renumberIndexes() local
175 static_assert((Space & 3) == 0, "InstrDist must be a multiple of 2*NUM"); in renumberIndexes()
178 unsigned index = startItr->getIndex(); in renumberIndexes()
180 curItr->setIndex(index += Space); in renumberIndexes()
183 } while (curItr != indexList.end() && curItr->getIndex() <= index); in renumberIndexes()
185 LLVM_DEBUG(dbgs() << "\n*** Renumbered SlotIndexes " << startItr->getIndex() in renumberIndexes()
186 << '-' << index << " ***\n"); in renumberIndexes()
194 bool includeStart = (Begin == MBB->begin()); in repairIndexesInRange()
199 startIdx = getInstructionIndex(*--Begin); in repairIndexesInRange()
202 if (End == MBB->end()) in repairIndexesInRange()
208 // optionally includes an additional position prior to MBB->begin(), indicated in repairIndexesInRange()
211 IndexList::iterator ListB = startIdx.listEntry()->getIterator(); in repairIndexesInRange()
212 IndexList::iterator ListI = endIdx.listEntry()->getIterator(); in repairIndexesInRange()
216 assert(ListI->getIndex() >= startIdx.getIndex() && in repairIndexesInRange()
220 MachineInstr *SlotMI = ListI->getInstr(); in repairIndexesInRange()
221 MachineInstr *MI = (MBBI != MBB->end() && !pastStart) ? &*MBBI : nullptr; in repairIndexesInRange()
225 --ListI; in repairIndexesInRange()
227 --MBBI; in repairIndexesInRange()
232 --MBBI; in repairIndexesInRange()
236 --ListI; in repairIndexesInRange()
245 --I; in repairIndexesInRange()
279 os << listEntry()->getIndex() << "Berd"[getSlot()]; in print()