aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-04 06:37:55 +0000
committerChris Lattner <sabre@nondot.org>2007-11-04 06:37:55 +0000
commit0647ebf1dc1045cf9614815581d2fe016ea5d229 (patch)
treebad3c120a26387d5ff2a78ad34cc7d6789007c67 /lib/Transforms
parente719831b1c8a9f5ed6996abb2ec511e43a3fc9d0 (diff)
Disable tail duplication of call instructions. The cost
metric is way off for these in general, and this works around buggy code like that in PR1764. we'll see if there is a big performance impact of this. If so, I'll revert it tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/TailDuplication.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp
index 22d8157fc0..1473caa2ea 100644
--- a/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/lib/Transforms/Scalar/TailDuplication.cpp
@@ -115,6 +115,11 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) {
for (unsigned Size = 0; I != Dest->end(); ++I) {
if (Size == Threshold) return false; // The block is too large.
+
+ // Don't tail duplicate call instructions. They are very large compared to
+ // other instructions.
+ if (isa<CallInst>(I) || isa<InvokeInst>(I)) return false;
+
// Only count instructions that are not debugger intrinsics.
if (!isa<DbgInfoIntrinsic>(I)) ++Size;
}