public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	 Bill Schmidt <wschmidt@linux.ibm.com>,
	Michael Meissner <meissner@linux.ibm.com>
Subject: Re: [PATCH] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]
Date: Mon, 29 Nov 2021 10:57:12 -0600	[thread overview]
Message-ID: <20211129165712.GU614@gate.crashing.org> (raw)
In-Reply-To: <3f2c6df2-e458-483c-facd-148a3cc3aead@linux.ibm.com>

Hi!

On Wed, Sep 01, 2021 at 02:55:51PM +0800, Kewen.Lin wrote:
> This patch is to fix the inconsistent behaviors for non-LTO mode
> and LTO mode.  As Martin pointed out, currently the function
> rs6000_can_inline_p simply makes it inlinable if callee_tree is
> NULL, but it's wrong, we should use the command line options
> from target_option_default_node as default.

This is not documented.

> It also replaces
> rs6000_isa_flags with the one from target_option_default_node
> when caller_tree is NULL as rs6000_isa_flags could probably
> change since initialization.

Is this enough then?  Are there no other places that use
rs6000_isa_flags?  Is it correct for us to have that variable at all
anymore?  Etc.

> +  bool always_inline =
> +    (DECL_DISREGARD_INLINE_LIMITS (callee)
> +     && lookup_attribute ("always_inline", DECL_ATTRIBUTES (callee)));

The "=" should start a line, not end it.  And please don't use
unnecessary parens.

> +  /* Some flags such as fusion can be tolerated for always inlines.  */
> +  unsigned HOST_WIDE_INT always_inline_safe_mask =
> +    (MASK_P8_FUSION | MASK_P10_FUSION | OPTION_MASK_SAVE_TOC_INDIRECT
> +     | OPTION_MASK_P8_FUSION_SIGN | OPTION_MASK_P10_FUSION_LD_CMPI
> +     | OPTION_MASK_P10_FUSION_2LOGICAL | OPTION_MASK_P10_FUSION_LOGADD
> +     | OPTION_MASK_P10_FUSION_ADDLOG | OPTION_MASK_P10_FUSION_2ADD
> +     | OPTION_MASK_PCREL_OPT);

Same.

The fusion ones are obvious.  The other two are not.  Please put those
two more obviously separate (not somewhere in the sea of fusion
options), and some comment wouldn't hurt either.  You can make it
separate statements even, make it really stand out.

Why are there OPTION_MASKs for separate P10 fusion types here, as well as
MASK_P10_FUSION?

> +
> +  if (always_inline) {
> +    caller_isa &= ~always_inline_safe_mask;
> +    callee_isa &= ~always_inline_safe_mask;
> +  }

"{" starts a new line, indented.


Segher

  parent reply	other threads:[~2021-11-29 16:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  6:55 Kewen.Lin
2021-09-15  8:42 ` PING^1 " Kewen.Lin
2021-09-28  8:58   ` PING^2 " Kewen.Lin
2021-10-13  2:33     ` PING^3 " Kewen.Lin
2021-10-20  9:30       ` PING^4 " Kewen.Lin
2021-11-04 10:57         ` PING^5 " Kewen.Lin
2021-11-22  2:24           ` PING^6 " Kewen.Lin
2021-11-29 16:57 ` Segher Boessenkool [this message]
2021-12-03  0:51   ` Michael Meissner
2021-12-03  3:30     ` Kewen.Lin
2021-12-03  3:46   ` [PATCH v2] " Kewen.Lin
2021-12-03 23:23     ` Peter Bergner
2021-12-06  9:35       ` Martin Liška
2021-12-06 14:40         ` Peter Bergner
2021-12-06 13:06     ` Segher Boessenkool
2021-12-06 14:52       ` Peter Bergner
2021-12-07  3:42       ` Kewen.Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211129165712.GU614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=meissner@linux.ibm.com \
    --cc=wschmidt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).