diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineTraceMetrics.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineTraceMetrics.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.cpp b/llvm/lib/CodeGen/MachineTraceMetrics.cpp index 3e6f36f..4f66f2e 100644 --- a/llvm/lib/CodeGen/MachineTraceMetrics.cpp +++ b/llvm/lib/CodeGen/MachineTraceMetrics.cpp @@ -71,7 +71,7 @@ bool MachineTraceMetrics::runOnMachineFunction(MachineFunction &Func) { Loops = &getAnalysis<MachineLoopInfo>(); SchedModel.init(&ST); BlockInfo.resize(MF->getNumBlockIDs()); - ProcReleaseAtCycles.resize(MF->getNumBlockIDs() * + ProcResourceCycles.resize(MF->getNumBlockIDs() * SchedModel.getNumProcResourceKinds()); return false; } @@ -126,7 +126,7 @@ MachineTraceMetrics::getResources(const MachineBasicBlock *MBB) { PI = SchedModel.getWriteProcResBegin(SC), PE = SchedModel.getWriteProcResEnd(SC); PI != PE; ++PI) { assert(PI->ProcResourceIdx < PRKinds && "Bad processor resource kind"); - PRCycles[PI->ProcResourceIdx] += PI->ReleaseAtCycle; + PRCycles[PI->ProcResourceIdx] += PI->Cycles; } } FBI->InstrCount = InstrCount; @@ -134,19 +134,19 @@ MachineTraceMetrics::getResources(const MachineBasicBlock *MBB) { // Scale the resource cycles so they are comparable. unsigned PROffset = MBB->getNumber() * PRKinds; for (unsigned K = 0; K != PRKinds; ++K) - ProcReleaseAtCycles[PROffset + K] = + ProcResourceCycles[PROffset + K] = PRCycles[K] * SchedModel.getResourceFactor(K); return FBI; } ArrayRef<unsigned> -MachineTraceMetrics::getProcReleaseAtCycles(unsigned MBBNum) const { +MachineTraceMetrics::getProcResourceCycles(unsigned MBBNum) const { assert(BlockInfo[MBBNum].hasResources() && - "getResources() must be called before getProcReleaseAtCycles()"); + "getResources() must be called before getProcResourceCycles()"); unsigned PRKinds = SchedModel.getNumProcResourceKinds(); - assert((MBBNum+1) * PRKinds <= ProcReleaseAtCycles.size()); - return ArrayRef(ProcReleaseAtCycles.data() + MBBNum * PRKinds, PRKinds); + assert((MBBNum+1) * PRKinds <= ProcResourceCycles.size()); + return ArrayRef(ProcResourceCycles.data() + MBBNum * PRKinds, PRKinds); } //===----------------------------------------------------------------------===// @@ -197,7 +197,7 @@ computeDepthResources(const MachineBasicBlock *MBB) { // Compute per-resource depths. ArrayRef<unsigned> PredPRDepths = getProcResourceDepths(PredNum); - ArrayRef<unsigned> PredPRCycles = MTM.getProcReleaseAtCycles(PredNum); + ArrayRef<unsigned> PredPRCycles = MTM.getProcResourceCycles(PredNum); for (unsigned K = 0; K != PRKinds; ++K) ProcResourceDepths[PROffset + K] = PredPRDepths[K] + PredPRCycles[K]; } @@ -212,7 +212,7 @@ computeHeightResources(const MachineBasicBlock *MBB) { // Compute resources for the current block. TBI->InstrHeight = MTM.getResources(MBB)->InstrCount; - ArrayRef<unsigned> PRCycles = MTM.getProcReleaseAtCycles(MBB->getNumber()); + ArrayRef<unsigned> PRCycles = MTM.getProcResourceCycles(MBB->getNumber()); // The trace tail is done. if (!TBI->Succ) { @@ -1204,7 +1204,7 @@ unsigned MachineTraceMetrics::Trace::getResourceDepth(bool Bottom) const { unsigned PRMax = 0; ArrayRef<unsigned> PRDepths = TE.getProcResourceDepths(getBlockNum()); if (Bottom) { - ArrayRef<unsigned> PRCycles = TE.MTM.getProcReleaseAtCycles(getBlockNum()); + ArrayRef<unsigned> PRCycles = TE.MTM.getProcResourceCycles(getBlockNum()); for (unsigned K = 0; K != PRDepths.size(); ++K) PRMax = std::max(PRMax, PRDepths[K] + PRCycles[K]); } else { @@ -1248,8 +1248,8 @@ unsigned MachineTraceMetrics::Trace::getResourceLength( PI != PE; ++PI) { if (PI->ProcResourceIdx != ResourceIdx) continue; - Cycles += (PI->ReleaseAtCycle * - TE.MTM.SchedModel.getResourceFactor(ResourceIdx)); + Cycles += + (PI->Cycles * TE.MTM.SchedModel.getResourceFactor(ResourceIdx)); } } return Cycles; @@ -1258,7 +1258,7 @@ unsigned MachineTraceMetrics::Trace::getResourceLength( for (unsigned K = 0; K != PRDepths.size(); ++K) { unsigned PRCycles = PRDepths[K] + PRHeights[K]; for (const MachineBasicBlock *MBB : Extrablocks) - PRCycles += TE.MTM.getProcReleaseAtCycles(MBB->getNumber())[K]; + PRCycles += TE.MTM.getProcResourceCycles(MBB->getNumber())[K]; PRCycles += extraCycles(ExtraInstrs, K); PRCycles -= extraCycles(RemoveInstrs, K); PRMax = std::max(PRMax, PRCycles); |