Lines Matching full:tbi

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