[llvm-commits] [llvm] r43668 - /llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp

Chris Lattner clattner at apple.com
Sun Nov 4 09:22:17 PST 2007


On Nov 3, 2007, at 11:37 PM, Chris Lattner wrote:

> Author: lattner
> Date: Sun Nov  4 01:37:55 2007
> New Revision: 43668
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43668&view=rev
> Log:
> 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.

This caused a couple of regressions (notably in treeadd on ppc g5,  
which is very sensitive to dispatch group formation) but several  
significant wins, particularly in code size.  I'm going to leave it in,

-Chris

>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=43668&r1=43667&r2=43668&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Sun Nov  4  
> 01:37:55 2007
> @@ -115,6 +115,11 @@
>
>   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;
>   }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list