pull check for return inst out of loop, never inline a callee that contains

an indirectbr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-11-01 03:07:53 +00:00
parent d0ec2352ae
commit b93a23a532

View File

@ -146,19 +146,21 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
if (CI->isLosslessCast() || isa<IntToPtrInst>(CI) ||
isa<PtrToIntInst>(CI))
continue;
} else if (const GetElementPtrInst *GEPI =
dyn_cast<GetElementPtrInst>(II)) {
} else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(II)){
// If a GEP has all constant indices, it will probably be folded with
// a load/store.
if (GEPI->hasAllConstantIndices())
continue;
}
if (isa<ReturnInst>(II))
++NumRets;
++NumInsts;
}
if (isa<ReturnInst>(BB->getTerminator()))
++NumRets;
if (isa<IndirectBrInst>(BB->getTerminator()))
NeverInline = true;
}
/// analyzeFunction - Fill in the current structure with information gleaned