[llvm-commits] [llvm-gcc-4.2] r51221 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp

Evan Cheng evan.cheng at apple.com
Mon May 19 11:37:14 PDT 2008


Actually the inline threshold should be much lower for -O2 and -Os and  
the various heuristics in InlineCost.cpp that increases threshold for  
certain functions should be disabled / turned down. Otherwise, it will  
definitely increase size.

Evan

On May 17, 2008, at 5:49 AM, Duncan Sands wrote:

> Author: baldrick
> Date: Sat May 17 07:49:30 2008
> New Revision: 51221
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51221&view=rev
> Log:
> Turn inlining on at -O2, but with the same
> threshold as for -Os.  This should mean that
> only inlining that doesn't increase the size
> is done.
>
> Modified:
>    llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
>
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=51221&r1=51220&r2=51221&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sat May 17 07:49:30 2008
> @@ -128,7 +128,7 @@
>     Args.push_back("--debug-pass=Structure");
>   if (flag_debug_pass_arguments)
>     Args.push_back("--debug-pass=Arguments");
> -  if (optimize_size)
> +  if (optimize_size || flag_inline_trees == 1)
>     // Reduce inline limit. Default limit is 200.
>     Args.push_back("--inline-threshold=100");
>   if (flag_unwind_tables)
> @@ -353,14 +353,10 @@
>     PM->add(createCFGSimplificationPass());       // Clean up after  
> IPCP & DAE
>     if (flag_unit_at_a_time && flag_exceptions)
>       PM->add(createPruneEHPass());               // Remove dead EH  
> info
> -
> -    if (optimize > 1) {
> -      if (flag_inline_trees > 1)                  // respect -fno- 
> inline-functions
> -        PM->add(createFunctionInliningPass());    // Inline small  
> functions
> -      if (optimize > 2)
> -        PM->add(createArgumentPromotionPass()); // Scalarize  
> uninlined fn args
> -    }
> -
> +    if (flag_inline_trees)                      // respect -fno- 
> inline-functions
> +      PM->add(createFunctionInliningPass());    // Inline small  
> functions
> +    if (optimize > 2)
> +      PM->add(createArgumentPromotionPass());   // Scalarize  
> uninlined fn args
>     PM->add(createTailDuplicationPass());       // Simplify cfg by  
> copying code
>     if (!lang_hooks.flag_no_builtin())
>       PM->add(createSimplifyLibCallsPass());    // Library Call  
> Optimizations
>
>
> _______________________________________________
> 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