Use BB.getNumNonPseudos() in more places.

Summary:
Use BB.getNumNonPseudos() in more places.

Fix analyze_potential script to pass the new parameter.

(cherry picked from FBD3844416)
This commit is contained in:
Maksim Panchenko 2016-09-09 14:42:35 -07:00
parent 71be567969
commit 617c6a13b7
3 changed files with 4 additions and 5 deletions

View file

@ -1469,7 +1469,7 @@ uint64_t BinaryFunction::getFunctionScore() {
uint64_t BBExecCount = BB->getExecutionCount();
if (BBExecCount == BinaryBasicBlock::COUNT_NO_PROFILE)
continue;
BBExecCount *= (BB->Instructions.size() - BB->getNumPseudos());
BBExecCount *= BB->getNumNonPseudos();
TotalScore += BBExecCount;
}
FunctionScore = TotalScore;

View file

@ -163,7 +163,7 @@ void InlineSmallFunctions::findInliningCandidates(
const auto &LastInstruction = *BB.rbegin();
// Check if the function is small enough and doesn't do a tail call.
if (BB.size() > 0 &&
(BB.size() - BB.getNumPseudos()) <= kMaxInstructions &&
BB.getNumNonPseudos() <= kMaxInstructions &&
BC.MIA->isReturn(LastInstruction) &&
!BC.MIA->isTailCall(LastInstruction)) {
InliningCandidates.insert(&Function);

View file

@ -56,9 +56,8 @@ void ClusterAlgorithm::computeClusterAverageFrequency() {
for (uint32_t I = 0, E = Clusters.size(); I < E; ++I) {
double Freq = 0.0;
for (auto BB : Clusters[I]) {
if (!BB->empty() && BB->size() != BB->getNumPseudos())
Freq += ((double) BB->getExecutionCount()) /
(BB->size() - BB->getNumPseudos());
if (BB->getNumNonPseudos() > 0)
Freq += ((double) BB->getExecutionCount()) / BB->getNumNonPseudos();
}
AvgFreq[I] = Freq;
}