diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-26 22:40:28 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-05-26 22:40:28 +0000 |
commit | 8b3ca84a8deeb946114f72d2a6aea243b630c4a8 (patch) | |
tree | 0a1d8bcc47b9a2725a5a2a71fc5d41931b81e4df /lib/Analysis | |
parent | a0f7ff334f86926356491ec78ab3066247dc93b1 (diff) | |
download | external_llvm-8b3ca84a8deeb946114f72d2a6aea243b630c4a8.zip external_llvm-8b3ca84a8deeb946114f72d2a6aea243b630c4a8.tar.gz external_llvm-8b3ca84a8deeb946114f72d2a6aea243b630c4a8.tar.bz2 |
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index 10c2d79..98dbb69 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -175,7 +175,11 @@ 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(); - ++NumCalls; + + // 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; } } |