summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailDuplication.cpp
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
commitce8c62665ae132494130a0c580099b879a6457fd (patch)
tree29d4230f054842cfb648650e0110e4065f7d5301 /llvm/lib/Transforms/Scalar/TailDuplication.cpp
parent65a146d4181681c250f13a8b89a8d9576553ba2b (diff)
downloadbcm5719-llvm-ce8c62665ae132494130a0c580099b879a6457fd.tar.gz
bcm5719-llvm-ce8c62665ae132494130a0c580099b879a6457fd.zip
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. llvm-svn: 43668
Diffstat (limited to 'llvm/lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/TailDuplication.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
index 22d8157fc08..1473caa2ea8 100644
--- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud