Lines Matching defs:TBI

165   TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
170 if (!TBI->Pred) {
171 TBI->InstrDepth = 0;
172 TBI->Head = MBB->getNumber();
180 unsigned PredNum = TBI->Pred->getNumber();
183 const FixedBlockInfo *PredFBI = MTM.getResources(TBI->Pred);
184 TBI->InstrDepth = PredTBI->InstrDepth + PredFBI->InstrCount;
185 TBI->Head = PredTBI->Head;
198 TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
203 TBI->InstrHeight = MTM.getResources(MBB)->InstrCount;
207 if (!TBI->Succ) {
208 TBI->Tail = MBB->getNumber();
216 unsigned SuccNum = TBI->Succ->getNumber();
219 TBI->InstrHeight += SuccTBI->InstrHeight;
220 TBI->Tail = SuccTBI->Tail;
228 // Check if depth resources for MBB are valid and return the TBI.
233 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
234 return TBI->hasValidDepth() ? TBI : nullptr;
237 // Check if height resources for MBB are valid and return the TBI.
242 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
243 return TBI->hasValidHeight() ? TBI : nullptr;
431 MachineTraceMetrics::TraceBlockInfo &TBI = LB.Blocks[To->getNumber()];
432 if (LB.Downward ? TBI.hasValidHeight() : TBI.hasValidDepth())
464 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
466 TBI.Pred = pickTracePred(I);
468 if (TBI.Pred)
469 dbgs() << "BB#" << TBI.Pred->getNumber() << '\n';
482 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
484 TBI.Succ = pickTraceSucc(I);
486 if (TBI.Succ)
487 dbgs() << "BB#" << TBI.Succ->getNumber() << '\n';
513 TraceBlockInfo &TBI = BlockInfo[Pred->getNumber()];
514 if (!TBI.hasValidHeight())
516 if (TBI.Succ == MBB) {
517 TBI.invalidateHeight();
521 // Verify that TBI.Succ is actually a *I successor.
522 assert((!TBI.Succ || Pred->isSuccessor(TBI.Succ)) && "CFG changed");
538 TraceBlockInfo &TBI = BlockInfo[Succ->getNumber()];
539 if (!TBI.hasValidDepth())
541 if (TBI.Pred == MBB) {
542 TBI.invalidateDepth();
546 // Verify that TBI.Pred is actually a *I predecessor.
547 assert((!TBI.Pred || Succ->isPredecessor(TBI.Pred)) && "CFG changed");
566 const TraceBlockInfo &TBI = BlockInfo[Num];
567 if (TBI.hasValidDepth() && TBI.Pred) {
569 assert(MBB->isPredecessor(TBI.Pred) && "CFG doesn't match trace");
570 assert(BlockInfo[TBI.Pred->getNumber()].hasValidDepth() &&
575 if (TBI.hasValidHeight() && TBI.Succ) {
577 assert(MBB->isSuccessor(TBI.Succ) && "CFG doesn't match trace");
578 assert(BlockInfo[TBI.Succ->getNumber()].hasValidHeight() &&
581 const MachineLoop *SuccLoop = getLoopFor(TBI.Succ);
582 assert(!(Loop && Loop == SuccLoop && TBI.Succ == Loop->getHeader()) &&
754 computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
755 assert(TBI.HasValidInstrDepths && "Missing depth info");
756 assert(TBI.HasValidInstrHeights && "Missing height info");
758 for (const LiveInReg &LIR : TBI.LiveIns) {
764 if (!DefTBI.isUsefulDominator(TBI))
781 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
782 assert(TBI.hasValidDepth() && "Incomplete trace");
783 if (TBI.HasValidInstrDepths)
786 MBB = TBI.Pred;
801 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
802 TBI.HasValidInstrDepths = true;
803 TBI.CriticalPath = 0;
807 dbgs() << format("%7u Instructions\n", TBI.InstrDepth);
819 if (TBI.HasValidInstrHeights)
820 TBI.CriticalPath = computeCrossBlockCriticalPath(TBI);
826 getPHIDeps(&UseMI, Deps, TBI.Pred, MTM.MRI);
836 if (!DepTBI.isUsefulDominator(TBI))
850 if (!TBI.HasValidInstrHeights) {
855 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Height);
856 DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << UseMI);
963 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
965 TBI.LiveIns.push_back(Reg);
978 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
979 assert(TBI.hasValidHeight() && "Incomplete trace");
980 if (TBI.HasValidInstrHeights)
983 TBI.LiveIns.clear();
984 MBB = TBI.Succ;
1000 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1001 for (LiveInReg &LI : TBI.LiveIns) {
1020 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1021 TBI.HasValidInstrHeights = true;
1022 TBI.CriticalPath = 0;
1025 dbgs() << format("%7u Instructions\n", TBI.InstrHeight);
1037 const MachineBasicBlock *Succ = TBI.Succ;
1054 unsigned Height = TBI.Succ ? Cycles.lookup(&PHI).Height : 0;
1095 if (!TBI.HasValidInstrDepths) {
1100 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Depth);
1101 DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << *MI);
1107 for (LiveInReg &LIR : TBI.LiveIns) {
1116 TBI.LiveIns.push_back(LiveInReg(RI->RegUnit, RI->Cycle));
1122 if (!TBI.HasValidInstrDepths)
1125 TBI.CriticalPath = std::max(TBI.CriticalPath,
1126 computeCrossBlockCriticalPath(TBI));
1127 DEBUG(dbgs() << "Critical path: " << TBI.CriticalPath << '\n');
1133 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1135 if (!TBI.hasValidDepth() || !TBI.hasValidHeight())
1137 if (!TBI.HasValidInstrDepths)
1139 if (!TBI.HasValidInstrHeights)
1142 return Trace(*this, TBI);
1187 unsigned Instrs = TBI.InstrDepth;
1239 unsigned Instrs = TBI.InstrDepth + TBI.InstrHeight;
1257 const TraceBlockInfo &TBI = TE.BlockInfo[UseMI->getParent()->getNumber()];
1259 return DepTBI.isUsefulDominator(TBI);
1300 unsigned MBBNum = &TBI - &TE.BlockInfo[0];
1302 OS << TE.getName() << " trace BB#" << TBI.Head << " --> BB#" << MBBNum
1303 << " --> BB#" << TBI.Tail << ':';
1304 if (TBI.hasValidHeight() && TBI.hasValidDepth())
1306 if (TBI.HasValidInstrDepths && TBI.HasValidInstrHeights)
1307 OS << ' ' << TBI.CriticalPath << " cycles.";
1309 const MachineTraceMetrics::TraceBlockInfo *Block = &TBI;
1317 Block = &TBI;