diff options
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index ee8370ec9c..f6664ed788 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -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 |