mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Continue counting intrinsics as instructions (except when they aren't, such as
debug info) and for being vector operations. Fixes regression from r147037. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
144bef462b
commit
6c6fcc4610
@ -63,8 +63,22 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
|
|||||||
|
|
||||||
// Special handling for calls.
|
// Special handling for calls.
|
||||||
if (isa<CallInst>(II) || isa<InvokeInst>(II)) {
|
if (isa<CallInst>(II) || isa<InvokeInst>(II)) {
|
||||||
if (isa<IntrinsicInst>(II))
|
if (const IntrinsicInst *IntrinsicI = dyn_cast<IntrinsicInst>(II)) {
|
||||||
continue; // Intrinsics have no argument setup and can't be inlined.
|
switch (IntrinsicI->getIntrinsicID()) {
|
||||||
|
default: break;
|
||||||
|
case Intrinsic::dbg_declare:
|
||||||
|
case Intrinsic::dbg_value:
|
||||||
|
case Intrinsic::invariant_start:
|
||||||
|
case Intrinsic::invariant_end:
|
||||||
|
case Intrinsic::lifetime_start:
|
||||||
|
case Intrinsic::lifetime_end:
|
||||||
|
case Intrinsic::objectsize:
|
||||||
|
case Intrinsic::ptr_annotation:
|
||||||
|
case Intrinsic::var_annotation:
|
||||||
|
// These intrinsics don't count as size.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImmutableCallSite CS(cast<Instruction>(II));
|
ImmutableCallSite CS(cast<Instruction>(II));
|
||||||
|
|
||||||
@ -83,7 +97,7 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
|
|||||||
isRecursive = true;
|
isRecursive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!callIsSmall(CS.getCalledFunction())) {
|
if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction())) {
|
||||||
// Each argument to a call takes on average one instruction to set up.
|
// Each argument to a call takes on average one instruction to set up.
|
||||||
NumInsts += CS.arg_size();
|
NumInsts += CS.arg_size();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user