public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Nathan Froyd <froydnj@codesourcery.com>
Cc: "William J. Schmidt" <wschmidt@linux.vnet.ibm.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix PR46728 (move pow/powi folds to tree phases)
Date: Fri, 13 May 2011 16:31:00 -0000	[thread overview]
Message-ID: <BANLkTinfqsyj4+-tjNYub14mfMZcawcWSg@mail.gmail.com> (raw)
In-Reply-To: <4DCD47E4.8070300@codesourcery.com>

On Fri, May 13, 2011 at 5:01 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> On 05/13/2011 10:52 AM, William J. Schmidt wrote:
>> This patch addresses PR46728, which notes that pow and powi need to be
>> lowered in tree phases to restore lost FMA opportunities and expose
>> vectorization opportunities.
>>
>> +struct gimple_opt_pass pass_lower_pow =
>> +{
>> + {
>> +  GIMPLE_PASS,
>> +  "lower_pow",                               /* name */
>> +  NULL,                                      /* gate */
>
> Please make this controlled by an option; this pass doesn't need to be run all
> the time.
>
> IMHO, the pass shouldn't run at anything less than -O3, but that's for other
> people to decide.

It was run unconditionally before, so unless we preserve the code at
expansion time we have to do it here.

I will have a closer look at the patch early next week.  Btw, I thought
of adding a POW_EXPR tree code that can take mixed-mode operands
to make foldings (eventually) simpler, but I'm not sure it's worth the
trouble.

The position of the pass is odd - why did you place it there?  I would
have placed it alongside pass_cse_sincos and pass_optimize_bswap.
The foldings should probably be done via fold-stmt only (where they
should already apply), and you won't catch things like pow(sqrt(...))
there because you only see the outer call.  That said, I'd be happier
if the patch just did the powi expansion and left the rest to somebody
else.

Richard.

  reply	other threads:[~2011-05-13 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 15:58 William J. Schmidt
2011-05-13 16:11 ` Nathan Froyd
2011-05-13 16:31   ` Richard Guenther [this message]
2011-05-13 16:31     ` William J. Schmidt
2011-05-14  1:09       ` William J. Schmidt
2011-05-13 17:25     ` Nathan Froyd
2011-05-16 15:52       ` Richard Guenther
2011-05-16 17:07 ` Richard Guenther
2011-05-16 19:49   ` William J. Schmidt
2011-05-17 13:00     ` Richard Guenther
2011-05-17 14:11       ` William J. Schmidt

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=BANLkTinfqsyj4+-tjNYub14mfMZcawcWSg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=froydnj@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=wschmidt@linux.vnet.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).