Lines Matching defs:TBI
190 TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
195 if (!TBI->Pred) {
196 TBI->InstrDepth = 0;
197 TBI->Head = MBB->getNumber();
205 unsigned PredNum = TBI->Pred->getNumber();
208 const FixedBlockInfo *PredFBI = MTM.getResources(TBI->Pred);
209 TBI->InstrDepth = PredTBI->InstrDepth + PredFBI->InstrCount;
210 TBI->Head = PredTBI->Head;
223 TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
228 TBI->InstrHeight = MTM.getResources(MBB)->InstrCount;
232 if (!TBI->Succ) {
233 TBI->Tail = MBB->getNumber();
240 unsigned SuccNum = TBI->Succ->getNumber();
243 TBI->InstrHeight += SuccTBI->InstrHeight;
244 TBI->Tail = SuccTBI->Tail;
252 // Check if depth resources for MBB are valid and return the TBI.
257 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
258 return TBI->hasValidDepth() ? TBI : nullptr;
261 // Check if height resources for MBB are valid and return the TBI.
266 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
267 return TBI->hasValidHeight() ? TBI : nullptr;
502 MachineTraceMetrics::TraceBlockInfo &TBI = LB.Blocks[To->getNumber()];
503 if (LB.Downward ? TBI.hasValidHeight() : TBI.hasValidDepth())
536 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
538 TBI.Pred = pickTracePred(I);
540 if (TBI.Pred)
541 dbgs() << printMBBReference(*TBI.Pred) << '\n';
554 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
556 TBI.Succ = pickTraceSucc(I);
558 if (TBI.Succ)
559 dbgs() << printMBBReference(*TBI.Succ) << '\n';
585 TraceBlockInfo &TBI = BlockInfo[Pred->getNumber()];
586 if (!TBI.hasValidHeight())
588 if (TBI.Succ == MBB) {
589 TBI.invalidateHeight();
593 // Verify that TBI.Succ is actually a *I successor.
594 assert((!TBI.Succ || Pred->isSuccessor(TBI.Succ)) && "CFG changed");
610 TraceBlockInfo &TBI = BlockInfo[Succ->getNumber()];
611 if (!TBI.hasValidDepth())
613 if (TBI.Pred == MBB) {
614 TBI.invalidateDepth();
618 // Verify that TBI.Pred is actually a *I predecessor.
619 assert((!TBI.Pred || Succ->isPredecessor(TBI.Pred)) && "CFG changed");
638 const TraceBlockInfo &TBI = BlockInfo[Num];
639 if (TBI.hasValidDepth() && TBI.Pred) {
641 assert(MBB->isPredecessor(TBI.Pred) && "CFG doesn't match trace");
642 assert(BlockInfo[TBI.Pred->getNumber()].hasValidDepth() &&
647 if (TBI.hasValidHeight() && TBI.Succ) {
649 assert(MBB->isSuccessor(TBI.Succ) && "CFG doesn't match trace");
650 assert(BlockInfo[TBI.Succ->getNumber()].hasValidHeight() &&
653 const MachineLoop *SuccLoop = getLoopFor(TBI.Succ);
654 assert(!(Loop && Loop == SuccLoop && TBI.Succ == Loop->getHeader()) &&
804 computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
805 assert(TBI.HasValidInstrDepths && "Missing depth info");
806 assert(TBI.HasValidInstrHeights && "Missing height info");
808 for (const LiveInReg &LIR : TBI.LiveIns) {
814 if (!DefTBI.isUsefulDominator(TBI))
823 updateDepth(MachineTraceMetrics::TraceBlockInfo &TBI, const MachineInstr &UseMI,
828 getPHIDeps(UseMI, Deps, TBI.Pred, MTM.MRI);
838 if (!DepTBI.isUsefulDominator(TBI))
852 if (TBI.HasValidInstrHeights) {
854 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Height);
855 LLVM_DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << UseMI);
884 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
885 assert(TBI.hasValidDepth() && "Incomplete trace");
886 if (TBI.HasValidInstrDepths)
889 MBB = TBI.Pred;
903 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
904 TBI.HasValidInstrDepths = true;
905 TBI.CriticalPath = 0;
909 dbgs() << format("%7u Instructions\n", TBI.InstrDepth);
921 if (TBI.HasValidInstrHeights)
922 TBI.CriticalPath = computeCrossBlockCriticalPath(TBI);
925 updateDepth(TBI, UseMI, RegUnits);
1027 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1029 TBI.LiveIns.push_back(Reg);
1042 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1043 assert(TBI.hasValidHeight() && "Incomplete trace");
1044 if (TBI.HasValidInstrHeights)
1047 TBI.LiveIns.clear();
1048 MBB = TBI.Succ;
1064 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1065 for (LiveInReg &LI : TBI.LiveIns) {
1084 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1085 TBI.HasValidInstrHeights = true;
1086 TBI.CriticalPath = 0;
1089 dbgs() << format("%7u Instructions\n", TBI.InstrHeight);
1101 const MachineBasicBlock *Succ = TBI.Succ;
1118 unsigned Height = TBI.Succ ? Cycles.lookup(&PHI).Height : 0;
1156 if (!TBI.HasValidInstrDepths) {
1161 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Depth);
1162 LLVM_DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << MI);
1168 for (LiveInReg &LIR : TBI.LiveIns) {
1176 TBI.LiveIns.push_back(LiveInReg(RU.RegUnit, RU.Cycle));
1182 if (!TBI.HasValidInstrDepths)
1185 TBI.CriticalPath = std::max(TBI.CriticalPath,
1186 computeCrossBlockCriticalPath(TBI));
1187 LLVM_DEBUG(dbgs() << "Critical path: " << TBI.CriticalPath << '\n');
1193 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1195 if (!TBI.hasValidDepth() || !TBI.hasValidHeight())
1197 if (!TBI.HasValidInstrDepths)
1199 if (!TBI.HasValidInstrHeights)
1202 return Trace(*this, TBI);
1246 unsigned Instrs = TBI.InstrDepth;
1298 unsigned Instrs = TBI.InstrDepth + TBI.InstrHeight;
1316 const TraceBlockInfo &TBI = TE.BlockInfo[UseMI.getParent()->getNumber()];
1318 return DepTBI.isUsefulDominator(TBI);
1359 unsigned MBBNum = &TBI - &TE.BlockInfo[0];
1361 OS << TE.getName() << " trace %bb." << TBI.Head << " --> %bb." << MBBNum
1362 << " --> %bb." << TBI.Tail << ':';
1363 if (TBI.hasValidHeight() && TBI.hasValidDepth())
1365 if (TBI.HasValidInstrDepths && TBI.HasValidInstrHeights)
1366 OS << ' ' << TBI.CriticalPath << " cycles.";
1368 const MachineTraceMetrics::TraceBlockInfo *Block = &TBI;
1376 Block = &TBI;