diff options
Diffstat (limited to 'lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r-- | lib/Transforms/Scalar/TailDuplication.cpp | 5 |
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; } |