public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: Richard Biener <rguenther@suse.de>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: fold strlen (s) eq/ne 0 to *s eq/ne 0 on GIMPLE
Date: Mon, 01 Aug 2016 07:22:00 -0000	[thread overview]
Message-ID: <CA+=Sn1nDG5ffGyDYU5HAJdPzT8_DkNqkbSUwTYyAUCruvY4D3Q@mail.gmail.com> (raw)
In-Reply-To: <CAAgBjM=VAMVeqB=Xey6_Y9Nohcp3nvLWdSNwd0p05yN=L2hiPw@mail.gmail.com>

On Mon, Aug 1, 2016 at 12:15 AM, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
> Hi Richard,
> The attached patch tries to fold strlen (s) eq/ne 0 to *s eq/ne 0 on GIMPLE.
> I am not sure where was the ideal place to put this transform in and ended up
> adding it to strlen_optimize_stmt().
> Does that look OK ?

I suspect it might be better in match.pd.

>
> I needed to add TODO_update_ssa to strlen pass, otherwise we hit the
> following assert in execute_todo():
> if (flag_checking
>       && cfun
>       && need_ssa_update_p (cfun))
>     gcc_assert (flags & TODO_update_ssa_any);

Also you only need to update the virtual SSAs rather than a full SSA update.

Thanks,
Andrew

>
> Bootstrap+test in progress on x86_64-unknown-linux-gnu.
>
> Thanks,
> Prathamesh

  reply	other threads:[~2016-08-01  7:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  7:16 Prathamesh Kulkarni
2016-08-01  7:22 ` Andrew Pinski [this message]
2016-08-01  7:35   ` Andrew Pinski
2016-08-01 11:46     ` Richard Biener
2016-08-01 11:33 ` Richard Biener
2016-08-11 10:36   ` Prathamesh Kulkarni
2016-08-11 10:48     ` Jakub Jelinek

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='CA+=Sn1nDG5ffGyDYU5HAJdPzT8_DkNqkbSUwTYyAUCruvY4D3Q@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=prathamesh.kulkarni@linaro.org \
    --cc=rguenther@suse.de \
    /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).