mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-26 22:45:05 +00:00
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:
parent
d0ec2352ae
commit
b93a23a532
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user