diff mbox series

i386: Update document for inlining rules

Message ID 20230706063712.409891-1-hongyu.wang@intel.com
State New
Headers show
Series i386: Update document for inlining rules | expand

Commit Message

Hongyu Wang July 6, 2023, 6:37 a.m. UTC
Hi,

This is a follow-up patch for
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623525.html
that updates document about x86 inlining rules.

Ok for trunk?

gcc/ChangeLog:

	* doc/extend.texi: Move x86 inlining rule to a new subsubsection
	and add description for inling of function with arch and tune
	attributes.
---
 gcc/doc/extend.texi | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

Comments

Uros Bizjak July 6, 2023, 7:22 a.m. UTC | #1
On Thu, Jul 6, 2023 at 8:39 AM Hongyu Wang <hongyu.wang@intel.com> wrote:
>
> Hi,
>
> This is a follow-up patch for
> https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623525.html
> that updates document about x86 inlining rules.
>
> Ok for trunk?
>
> gcc/ChangeLog:
>
>         * doc/extend.texi: Move x86 inlining rule to a new subsubsection
>         and add description for inling of function with arch and tune
>         attributes.

LGTM.

Thanks,
Uros.

> ---
>  gcc/doc/extend.texi | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
> index d1b018ee6d6..d701b4d1d41 100644
> --- a/gcc/doc/extend.texi
> +++ b/gcc/doc/extend.texi
> @@ -7243,11 +7243,6 @@ Prefer 256-bit vector width for instructions.
>  Prefer 512-bit vector width for instructions.
>  @end table
>
> -On the x86, the inliner does not inline a
> -function that has different target options than the caller, unless the
> -callee has a subset of the target options of the caller.  For example
> -a function declared with @code{target("sse3")} can inline a function
> -with @code{target("sse2")}, since @code{-msse3} implies @code{-msse2}.
>  @end table
>
>  @cindex @code{indirect_branch} function attribute, x86
> @@ -7361,6 +7356,20 @@ counterpart to option @option{-mno-direct-extern-access}.
>
>  @end table
>
> +@subsubsection Inlining rules
> +On the x86, the inliner does not inline a
> +function that has different target options than the caller, unless the
> +callee has a subset of the target options of the caller.  For example
> +a function declared with @code{target("sse3")} can inline a function
> +with @code{target("sse2")}, since @code{-msse3} implies @code{-msse2}.
> +
> +Besides the basic rule, when a function specifies
> +@code{target("arch=@var{ARCH}")} or @code{target("tune=@var{TUNE}")}
> +attribute, the inlining rule will be different. It allows inlining of
> +a function with default @option{-march=x86-64} and
> +@option{-mtune=generic} specified, or a function that has a subset
> +of ISA features and marked with always_inline.
> +
>  @node Xstormy16 Function Attributes
>  @subsection Xstormy16 Function Attributes
>
> --
> 2.31.1
>
diff mbox series

Patch

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index d1b018ee6d6..d701b4d1d41 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -7243,11 +7243,6 @@  Prefer 256-bit vector width for instructions.
 Prefer 512-bit vector width for instructions.
 @end table
 
-On the x86, the inliner does not inline a
-function that has different target options than the caller, unless the
-callee has a subset of the target options of the caller.  For example
-a function declared with @code{target("sse3")} can inline a function
-with @code{target("sse2")}, since @code{-msse3} implies @code{-msse2}.
 @end table
 
 @cindex @code{indirect_branch} function attribute, x86
@@ -7361,6 +7356,20 @@  counterpart to option @option{-mno-direct-extern-access}.
 
 @end table
 
+@subsubsection Inlining rules
+On the x86, the inliner does not inline a
+function that has different target options than the caller, unless the
+callee has a subset of the target options of the caller.  For example
+a function declared with @code{target("sse3")} can inline a function
+with @code{target("sse2")}, since @code{-msse3} implies @code{-msse2}.
+
+Besides the basic rule, when a function specifies
+@code{target("arch=@var{ARCH}")} or @code{target("tune=@var{TUNE}")}
+attribute, the inlining rule will be different. It allows inlining of
+a function with default @option{-march=x86-64} and
+@option{-mtune=generic} specified, or a function that has a subset
+of ISA features and marked with always_inline.
+
 @node Xstormy16 Function Attributes
 @subsection Xstormy16 Function Attributes