summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-03-17 23:41:20 +0000
committerDevang Patel <dpatel@apple.com>2008-03-17 23:41:20 +0000
commitb176038f989d98ac9f5f1dc2b52b6ef1723b2b78 (patch)
treee6d74bdd8e26b0baf5463de8aafcff9655d4b822
parent257f75d0b88a7d3d5ba5b7b7908a97f6dd56e27d (diff)
downloadexternal_llvm-b176038f989d98ac9f5f1dc2b52b6ef1723b2b78.zip
external_llvm-b176038f989d98ac9f5f1dc2b52b6ef1723b2b78.tar.gz
external_llvm-b176038f989d98ac9f5f1dc2b52b6ef1723b2b78.tar.bz2
Update heuritics that estimates cost of call instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48474 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/LoopUnroll.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp
index ff8ece2..71a5955 100644
--- a/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -100,6 +100,11 @@ static unsigned ApproximateLoopSize(const Loop *L) {
// Ignore instructions only used by the loop terminator.
} else if (isa<DbgInfoIntrinsic>(I)) {
// Ignore debug instructions
+ } else if (isa<CallInst>(I)) {
+ if (isa<IntrinsicInst>(I))
+ Size = Size + 3;
+ else
+ Size = Size + 10;
} else {
++Size;
}