Lines Matching defs:TBI

176   TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
181 if (!TBI->Pred) {
182 TBI->InstrDepth = 0;
183 TBI->Head = MBB->getNumber();
191 unsigned PredNum = TBI->Pred->getNumber();
194 const FixedBlockInfo *PredFBI = MTM.getResources(TBI->Pred);
195 TBI->InstrDepth = PredTBI->InstrDepth + PredFBI->InstrCount;
196 TBI->Head = PredTBI->Head;
209 TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
214 TBI->InstrHeight = MTM.getResources(MBB)->InstrCount;
218 if (!TBI->Succ) {
219 TBI->Tail = MBB->getNumber();
226 unsigned SuccNum = TBI->Succ->getNumber();
229 TBI->InstrHeight += SuccTBI->InstrHeight;
230 TBI->Tail = SuccTBI->Tail;
238 // Check if depth resources for MBB are valid and return the TBI.
243 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
244 return TBI->hasValidDepth() ? TBI : nullptr;
247 // Check if height resources for MBB are valid and return the TBI.
252 const TraceBlockInfo *TBI = &BlockInfo[MBB->getNumber()];
253 return TBI->hasValidHeight() ? TBI : nullptr;
473 MachineTraceMetrics::TraceBlockInfo &TBI = LB.Blocks[To->getNumber()];
474 if (LB.Downward ? TBI.hasValidHeight() : TBI.hasValidDepth())
507 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
509 TBI.Pred = pickTracePred(I);
511 if (TBI.Pred)
512 dbgs() << printMBBReference(*TBI.Pred) << '\n';
525 TraceBlockInfo &TBI = BlockInfo[I->getNumber()];
527 TBI.Succ = pickTraceSucc(I);
529 if (TBI.Succ)
530 dbgs() << printMBBReference(*TBI.Succ) << '\n';
556 TraceBlockInfo &TBI = BlockInfo[Pred->getNumber()];
557 if (!TBI.hasValidHeight())
559 if (TBI.Succ == MBB) {
560 TBI.invalidateHeight();
564 // Verify that TBI.Succ is actually a *I successor.
565 assert((!TBI.Succ || Pred->isSuccessor(TBI.Succ)) && "CFG changed");
581 TraceBlockInfo &TBI = BlockInfo[Succ->getNumber()];
582 if (!TBI.hasValidDepth())
584 if (TBI.Pred == MBB) {
585 TBI.invalidateDepth();
589 // Verify that TBI.Pred is actually a *I predecessor.
590 assert((!TBI.Pred || Succ->isPredecessor(TBI.Pred)) && "CFG changed");
609 const TraceBlockInfo &TBI = BlockInfo[Num];
610 if (TBI.hasValidDepth() && TBI.Pred) {
612 assert(MBB->isPredecessor(TBI.Pred) && "CFG doesn't match trace");
613 assert(BlockInfo[TBI.Pred->getNumber()].hasValidDepth() &&
618 if (TBI.hasValidHeight() && TBI.Succ) {
620 assert(MBB->isSuccessor(TBI.Succ) && "CFG doesn't match trace");
621 assert(BlockInfo[TBI.Succ->getNumber()].hasValidHeight() &&
624 const MachineLoop *SuccLoop = getLoopFor(TBI.Succ);
625 assert(!(Loop && Loop == SuccLoop && TBI.Succ == Loop->getHeader()) &&
776 computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
777 assert(TBI.HasValidInstrDepths && "Missing depth info");
778 assert(TBI.HasValidInstrHeights && "Missing height info");
780 for (const LiveInReg &LIR : TBI.LiveIns) {
786 if (!DefTBI.isUsefulDominator(TBI))
795 updateDepth(MachineTraceMetrics::TraceBlockInfo &TBI, const MachineInstr &UseMI,
800 getPHIDeps(UseMI, Deps, TBI.Pred, MTM.MRI);
810 if (!DepTBI.isUsefulDominator(TBI))
824 if (TBI.HasValidInstrHeights) {
826 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Height);
827 LLVM_DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << UseMI);
856 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
857 assert(TBI.hasValidDepth() && "Incomplete trace");
858 if (TBI.HasValidInstrDepths)
861 MBB = TBI.Pred;
875 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
876 TBI.HasValidInstrDepths = true;
877 TBI.CriticalPath = 0;
881 dbgs() << format("%7u Instructions\n", TBI.InstrDepth);
893 if (TBI.HasValidInstrHeights)
894 TBI.CriticalPath = computeCrossBlockCriticalPath(TBI);
897 updateDepth(TBI, UseMI, RegUnits);
999 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1001 TBI.LiveIns.push_back(Reg);
1014 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1015 assert(TBI.hasValidHeight() && "Incomplete trace");
1016 if (TBI.HasValidInstrHeights)
1019 TBI.LiveIns.clear();
1020 MBB = TBI.Succ;
1036 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1037 for (LiveInReg &LI : TBI.LiveIns) {
1056 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1057 TBI.HasValidInstrHeights = true;
1058 TBI.CriticalPath = 0;
1061 dbgs() << format("%7u Instructions\n", TBI.InstrHeight);
1073 const MachineBasicBlock *Succ = TBI.Succ;
1090 unsigned Height = TBI.Succ ? Cycles.lookup(&PHI).Height : 0;
1128 if (!TBI.HasValidInstrDepths) {
1133 TBI.CriticalPath = std::max(TBI.CriticalPath, Cycle + MICycles.Depth);
1134 LLVM_DEBUG(dbgs() << TBI.CriticalPath << '\t' << Cycle << '\t' << MI);
1140 for (LiveInReg &LIR : TBI.LiveIns) {
1148 TBI.LiveIns.push_back(LiveInReg(RU.RegUnit, RU.Cycle));
1154 if (!TBI.HasValidInstrDepths)
1157 TBI.CriticalPath = std::max(TBI.CriticalPath,
1158 computeCrossBlockCriticalPath(TBI));
1159 LLVM_DEBUG(dbgs() << "Critical path: " << TBI.CriticalPath << '\n');
1165 TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
1167 if (!TBI.hasValidDepth() || !TBI.hasValidHeight())
1169 if (!TBI.HasValidInstrDepths)
1171 if (!TBI.HasValidInstrHeights)
1174 return Trace(*this, TBI);
1218 unsigned Instrs = TBI.InstrDepth;
1270 unsigned Instrs = TBI.InstrDepth + TBI.InstrHeight;
1288 const TraceBlockInfo &TBI = TE.BlockInfo[UseMI.getParent()->getNumber()];
1290 return DepTBI.isUsefulDominator(TBI);
1331 unsigned MBBNum = &TBI - &TE.BlockInfo[0];
1333 OS << TE.getName() << " trace %bb." << TBI.Head << " --> %bb." << MBBNum
1334 << " --> %bb." << TBI.Tail << ':';
1335 if (TBI.hasValidHeight() && TBI.hasValidDepth())
1337 if (TBI.HasValidInstrDepths && TBI.HasValidInstrHeights)
1338 OS << ' ' << TBI.CriticalPath << " cycles.";
1340 const MachineTraceMetrics::TraceBlockInfo *Block = &TBI;
1348 Block = &TBI;