mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Avoid counting InlineAsm as a call - it prevents loop unrolling.
PR7026 Patch by Pekka Jääskeläinen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a0f7ff334f
commit
8b3ca84a8d
@ -175,6 +175,10 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
|
||||
if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction())) {
|
||||
// Each argument to a call takes on average one instruction to set up.
|
||||
NumInsts += CS.arg_size();
|
||||
|
||||
// We don't want inline asm to count as a call - that would prevent loop
|
||||
// unrolling. The argument setup cost is still real, though.
|
||||
if (!isa<InlineAsm>(CS.getCalledValue()))
|
||||
++NumCalls;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user