Lines Matching full:trace
10 #define DEBUG_TYPE "machine-trace-metrics"
32 "machine-trace-metrics", "Machine Trace Metrics", false, true)
36 "machine-trace-metrics", "Machine Trace Metrics", false, true)
77 // those instructions don't depend on any given trace strategy.
122 // Only update resources related to the trace above MBB.
127 // Compute resources from trace above. The top block is simple.
137 assert(PredTBI->hasValidDepth() && "Trace above has not been computed yet");
144 // Only update resources related to the trace below MBB.
152 // The trace tail is done.
161 assert(SuccTBI->hasValidHeight() && "Trace below has not been computed yet");
185 // Trace Selection Strategies
188 // A trace selection strategy is implemented as a sub-class of Ensemble. The
189 // trace through a block B is computed by two DFS traversals of the CFG
199 // trace, except as the trace head. Below the center block, loop exiting edges
208 // MinInstrCountEnsemble - Pick the trace that executes the least number of
280 // Get an Ensemble sub-class for the requested trace strategy.
283 assert(strategy < TS_NumStrategies && "Invalid trace strategy enum");
291 default: llvm_unreachable("Invalid trace strategy enum");
315 // Trace building
349 // From is null once when To is the trace center block.
367 /// Compute the trace through MBB.
369 DEBUG(dbgs() << "Computing " << getName() << " trace through BB#"
374 // Run an upwards post-order search for the trace start.
390 // The trace leading to I is now known, compute the depth resources.
394 // Run a downwards post-order search for the trace end.
410 // The trace leaving I is now known, compute the height resources.
491 assert(MBB->isPredecessor(TBI.Pred) && "CFG doesn't match trace");
493 "Trace is broken, depth should have been invalidated.");
495 assert(!(Loop && MBB == Loop->getHeader()) && "Trace contains backedge");
499 assert(MBB->isSuccessor(TBI.Succ) && "CFG doesn't match trace");
501 "Trace is broken, height should have been invalidated.");
505 "Trace contains backedge");
574 // No predecessor at the beginning of a trace. Ignore dependencies.
657 /// The length of the critical path through a trace is the maximum of two path
660 /// 1. The maximum height+depth over all instructions in the trace center block.
663 /// possible that the critical path through the trace doesn't include any
678 // Ignore dependencies outside the current trace.
689 /// trace. This assumes that the trace through MBB has already been computed.
692 // The top of the trace may already be computed, and HasValidInstrDepths
694 // block in the trace that needs to be recomputed.
698 assert(TBI.hasValidDepth() && "Incomplete trace");
706 // in the trace. We should track any live-out physregs that were defined in
707 // the trace. This is quite rare in SSA form, typically created by CSE
712 // Go through trace blocks in top-down order, stopping after the center block.
742 // Ignore dependencies from outside the current trace.
854 /// Trace.back(), add it to the live-in lists of all the blocks in Trace. Stop
858 ArrayRef<const MachineBasicBlock*> Trace) {
859 assert(!Trace.empty() && "Trace should contain at least one block");
864 // Reg is live-in to all blocks in Trace that follow DefMBB.
865 Trace.size(); i; --i) {
866 const MachineBasicBlock *MBB = Trace[i-1];
875 /// Compute instruction heights in the trace through MBB. This updates MBB and
876 /// the blocks below it in the trace. It is assumed that the trace has already
880 // The bottom of the trace may already be computed.
885 assert(TBI.hasValidHeight() && "Incomplete trace");
893 // As we move upwards in the trace, keep track of instructions that are
894 // required by deeper trace instructions. Map MI -> height required so far.
902 // If the bottom of the trace was already precomputed, initialize heights
904 // MBB is the highest precomputed block in the trace.
922 // Go through the trace blocks in bottom-up order.
931 // Get dependencies from PHIs in the trace successor.
933 // If MBB is the last block in the trace, and it has a back-edge to the
964 // trace below.
1027 MachineTraceMetrics::Trace
1033 return Trace(*this, BlockInfo[MBB->getNumber()]);
1037 MachineTraceMetrics::Trace::getInstrSlack(const MachineInstr *MI) const {
1040 "MI must be in the trace center block");
1046 MachineTraceMetrics::Trace::getPHIDepth(const MachineInstr *PHI) const {
1060 unsigned MachineTraceMetrics::Trace::getResourceDepth(bool Bottom) const {
1073 unsigned MachineTraceMetrics::Trace::
1121 void MachineTraceMetrics::Trace::print(raw_ostream &OS) const {
1124 OS << TE.getName() << " trace BB#" << TBI.Head << " --> BB#" << MBBNum