Update heuritics that estimates cost of call instructions.
authorDevang Patel <dpatel@apple.com>
Mon, 17 Mar 2008 23:41:20 +0000 (23:41 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 17 Mar 2008 23:41:20 +0000 (23:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48474 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnroll.cpp

index ff8ece2aa8c1c2520dc361c98449cbcc5b77c17f..71a5955b76b0d8d82b09d9a751872645570f6a55 100644 (file)
@@ -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;
       }