• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: inlining
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inlining


  • Subject: Re: inlining
  • From: Steve Checkoway <email@hidden>
  • Date: Mon, 17 Dec 2007 11:04:29 -0800


On Dec 17, 2007, at 10:34 AM, David Rowland wrote:

Thanks to all. I just wanted to inline in one module. The key was setting the optimization level of the target to any value above "none". The next question is how far the compiler will go (how many levels of function calls) to do the inlining. I assume the limit is not small.

To quote from the man page:
-finline-limit=n
By default, GCC limits the size of functions that can be inlined.
This flag allows the control of this limit for functions that are
explicitly marked as inline (i.e., marked with the inline keyword or
defined within the class definition in c++). n is the size of
functions that can be inlined in number of pseudo instructions (not
counting parameter handling). The default value of n is 600.
Increasing this value can result in more inlined code at the cost of
compilation time and memory consumption. Decreasing usually makes the
compilation faster and less code will be inlined (which presumably
means slower programs). This option is particularly useful for
programs that use inlining heavily such as those based on recursive
templates with C++.


Inlining is actually controlled by a number of parameters, which may
be specified individually by using --param name=value. The
-finline-limit=n option sets some of these parameters as follows:


            @item max-inline-insns-single
             is set to I<n>/2.
            @item max-inline-insns-auto
             is set to I<n>/2.
            @item min-inline-insns
             is set to 130 or I<n>/4, whichever is smaller.
            @item max-inline-insns-rtl
             is set to I<n>.

See below for a documentation of the individual parameters controlling
inlining.


Note: pseudo instruction represents, in this particular context, an
abstract measurement of function's size. In no way, it represents a
count of assembly instructions and as such its exact meaning might
change from one release to an another.

I've found that the default value of 600 can cause compilation times that are too long for some projects. 300 was found to be a reasonable compromise.


I notice that the optimization level can be set at the target and at the project level. But the target always overrides the project, so why even have it as a project option?


This is true of (almost?) every setting. If the optimization level is not set at the target level, the one set at the project level is used. This is explained in more detail in Xcode documents, one would assume.

--
Steve Checkoway

    "Anyone who says that the solution is to educate the users
    hasn't ever met an actual user." -- Bruce Schneier




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: inlining (From: Sanjay Patel <email@hidden>)
 >Re: inlining (From: David Rowland <email@hidden>)

  • Prev by Date: Re: Subversion and svn_load_dirs.pl
  • Next by Date: SenTestingKit framework
  • Previous by thread: Re: inlining
  • Next by thread: Re: inlining
  • Index(es):
    • Date
    • Thread