Lines Matching full:trace
10 #define DEBUG_TYPE "machine-trace-metrics"
33 "machine-trace-metrics", "Machine Trace Metrics", false, true)
37 "machine-trace-metrics", "Machine Trace Metrics", false, true)
80 // those instructions don't depend on any given trace strategy.
164 // Only update resources related to the trace above MBB.
171 // Compute resources from trace above. The top block is simple.
184 assert(PredTBI->hasValidDepth() && "Trace above has not been computed yet");
197 // Only update resources related to the trace below MBB.
208 // The trace tail is done.
220 assert(SuccTBI->hasValidHeight() && "Trace below has not been computed yet");
250 /// by all blocks preceding MBB in its trace. It does not include instructions
265 /// by this block and all blocks following it in its trace.
278 // Trace Selection Strategies
281 // A trace selection strategy is implemented as a sub-class of Ensemble. The
282 // trace through a block B is computed by two DFS traversals of the CFG
292 // trace, except as the trace head. Below the center block, loop exiting edges
301 // MinInstrCountEnsemble - Pick the trace that executes the least number of
373 // Get an Ensemble sub-class for the requested trace strategy.
376 assert(strategy < TS_NumStrategies && "Invalid trace strategy enum");
384 default: llvm_unreachable("Invalid trace strategy enum");
408 // Trace building
442 // From is null once when To is the trace center block.
460 /// Compute the trace through MBB.
462 DEBUG(dbgs() << "Computing " << getName() << " trace through BB#"
467 // Run an upwards post-order search for the trace start.
483 // The trace leading to I is now known, compute the depth resources.
487 // Run a downwards post-order search for the trace end.
503 // The trace leaving I is now known, compute the height resources.
584 assert(MBB->isPredecessor(TBI.Pred) && "CFG doesn't match trace");
586 "Trace is broken, depth should have been invalidated.");
588 assert(!(Loop && MBB == Loop->getHeader()) && "Trace contains backedge");
592 assert(MBB->isSuccessor(TBI.Succ) && "CFG doesn't match trace");
594 "Trace is broken, height should have been invalidated.");
598 "Trace contains backedge");
667 // No predecessor at the beginning of a trace. Ignore dependencies.
750 /// The length of the critical path through a trace is the maximum of two path
753 /// 1. The maximum height+depth over all instructions in the trace center block.
756 /// possible that the critical path through the trace doesn't include any
771 // Ignore dependencies outside the current trace.
782 /// trace. This assumes that the trace through MBB has already been computed.
785 // The top of the trace may already be computed, and HasValidInstrDepths
787 // block in the trace that needs to be recomputed.
791 assert(TBI.hasValidDepth() && "Incomplete trace");
799 // in the trace. We should track any live-out physregs that were defined in
800 // the trace. This is quite rare in SSA form, typically created by CSE
805 // Go through trace blocks in top-down order, stopping after the center block.
848 // Ignore dependencies from outside the current trace.
958 /// Trace.back(), add it to the live-in lists of all the blocks in Trace. Stop
962 ArrayRef<const MachineBasicBlock*> Trace) {
963 assert(!Trace.empty() && "Trace should contain at least one block");
968 // Reg is live-in to all blocks in Trace that follow DefMBB.
969 for (unsigned i = Trace.size(); i; --i) {
970 const MachineBasicBlock *MBB = Trace[i-1];
979 /// Compute instruction heights in the trace through MBB. This updates MBB and
980 /// the blocks below it in the trace. It is assumed that the trace has already
984 // The bottom of the trace may already be computed.
989 assert(TBI.hasValidHeight() && "Incomplete trace");
997 // As we move upwards in the trace, keep track of instructions that are
998 // required by deeper trace instructions. Map MI -> height required so far.
1006 // If the bottom of the trace was already precomputed, initialize heights
1008 // MBB is the highest precomputed block in the trace.
1026 // Go through the trace blocks in bottom-up order.
1047 // Get dependencies from PHIs in the trace successor.
1049 // If MBB is the last block in the trace, and it has a back-edge to the
1080 // trace below.
1143 MachineTraceMetrics::Trace
1149 return Trace(*this, BlockInfo[MBB->getNumber()]);
1153 MachineTraceMetrics::Trace::getInstrSlack(const MachineInstr *MI) const {
1156 "MI must be in the trace center block");
1162 MachineTraceMetrics::Trace::getPHIDepth(const MachineInstr *PHI) const {
1176 unsigned MachineTraceMetrics::Trace::getResourceDepth(bool Bottom) const {
1202 unsigned MachineTraceMetrics::Trace::
1276 void MachineTraceMetrics::Trace::print(raw_ostream &OS) const {
1279 OS << TE.getName() << " trace BB#" << TBI.Head << " --> BB#" << MBBNum