summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnroll.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
index 71a5955b76b..1962c14d5d6 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -101,6 +101,10 @@ static unsigned ApproximateLoopSize(const Loop *L) {
} else if (isa<DbgInfoIntrinsic>(I)) {
// Ignore debug instructions
} else if (isa<CallInst>(I)) {
+ // Estimate size overhead introduced by call instructions which
+ // is higher than other instructions. Here 3 and 10 are magic
+ // numbers that help one isolated test case from PR2067 without
+ // negatively impacting measured benchmarks.
if (isa<IntrinsicInst>(I))
Size = Size + 3;
else
OpenPOWER on IntegriCloud