public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Tom de Vries <tdevries@suse.de>
Cc: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][ldist] Don't add lib calls with -fno-tree-loop-distribute-patterns
Date: Tue, 1 Feb 2022 08:04:37 +0100	[thread overview]
Message-ID: <CAFiYyc3jYQdx3cE7xe=D9ptnooAK8=ZODnnyPfDkdAKq2AToJg@mail.gmail.com> (raw)
In-Reply-To: <3b14d728-35d3-251a-44b8-e152b92d5dd5@suse.de>

On Mon, Jan 31, 2022 at 5:26 PM Tom de Vries <tdevries@suse.de> wrote:
>
> [ was: Re: [RFC] ldist: Recognize rawmemchr loop patterns ]
>
> On 1/31/22 16:00, Richard Biener wrote:
> >> I'm running into PR56888 (
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888 ) on nvptx due to
> >> this, f.i. in gcc/testsuite/gcc.c-torture/execute/builtins/strlen.c,
> >> where gcc/testsuite/gcc.c-torture/execute/builtins/lib/strlen.c contains
> >> a strlen function, with a strlen loop, which is transformed by
> >> pass_loop_distribution into a __builtin_strlen, which is then expanded
> >> into a strlen call, creating a self-recursive function. [ And on nvptx,
> >> that happens to result in a compilation failure, which is how I found
> >> this. ]
> >>
> >> According to this (
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888#c21 ) comment:
> >> ...
> >> -fno-tree-loop-distribute-patterns is the reliable way to not
> >> transform loops into library calls.
> >> ...
> >>
> >> Then should we have something along the lines of:
> >> ...
> >> $ git diff
> >> diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
> >> index 6fe59cd56855..9a211d30cd7e 100644
> >> --- a/gcc/tree-loop-distribution.c
> >> +++ b/gcc/tree-loop-distribution.c
> >> @@ -3683,7 +3683,11 @@ loop_distribution::transform_reduction_loop
> >>                  && TYPE_PRECISION (ptr_type_node) >= 32)
> >>                 || (TYPE_OVERFLOW_UNDEFINED (reduction_var_type)
> >>                     && TYPE_PRECISION (reduction_var_type) <=
> >> TYPE_PRECISION (sizetype)))
> >> -         && builtin_decl_implicit (BUILT_IN_STRLEN))
> >> +         && builtin_decl_implicit (BUILT_IN_STRLEN)
> >> +         && flag_tree_loop_distribute_patterns)
> >>           generate_strlen_builtin (loop, reduction_var, load_iv.base,
> >>                                    reduction_iv.base, loc);
> >>          else if (direct_optab_handler (rawmemchr_optab, TYPE_MODE
> >> (load_type))
> >> ...
> >> ?
> >>
> >> Or is the comment no longer valid?
> >
> > It is still valid - and yes, I think we need to guard it with this flag
> > but please do it in the caller to transform_reduction_loop.
>
> Done.
>
> Ok for trunk?

OK.

> Thanks,
> - Tom

      reply	other threads:[~2022-02-01  7:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 12:47 [RFC] ldist: Recognize rawmemchr loop patterns Stefan Schulze Frielinghaus
2021-02-09  8:57 ` Richard Biener
2021-02-14 10:27   ` Stefan Schulze Frielinghaus
2021-02-25 17:01     ` Stefan Schulze Frielinghaus
2021-02-25 23:49       ` Jeff Law
2021-03-02 12:29     ` Richard Biener
2021-03-03 17:17       ` Stefan Schulze Frielinghaus
2021-03-16 17:13         ` Stefan Schulze Frielinghaus
2021-04-08  8:23           ` Stefan Schulze Frielinghaus
2021-05-04 17:25             ` Stefan Schulze Frielinghaus
2021-05-05  9:36           ` Richard Biener
2021-05-05 10:03             ` Richard Biener
2021-05-07 12:32             ` Stefan Schulze Frielinghaus
2021-05-20  9:24               ` Richard Biener
2021-05-20 18:37                 ` Stefan Schulze Frielinghaus
2021-06-14 17:26                   ` Stefan Schulze Frielinghaus
2021-06-16 14:22                     ` Richard Biener
2021-06-25 10:23                       ` Stefan Schulze Frielinghaus
2021-08-06 14:02                         ` Stefan Schulze Frielinghaus
2021-08-20 10:35                         ` Richard Biener
2021-09-03  8:00                           ` Stefan Schulze Frielinghaus
2021-09-06  9:56                             ` Richard Biener
2021-09-13 14:53                               ` Stefan Schulze Frielinghaus
2021-09-17  8:08                                 ` Richard Biener
2021-10-11 16:02                                   ` Stefan Schulze Frielinghaus
2022-01-31 13:16                                   ` Tom de Vries
2022-01-31 15:00                                     ` Richard Biener
2022-01-31 16:26                                       ` [PATCH][ldist] Don't add lib calls with -fno-tree-loop-distribute-patterns Tom de Vries
2022-02-01  7:04                                         ` Richard Biener [this message]

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='CAFiYyc3jYQdx3cE7xe=D9ptnooAK8=ZODnnyPfDkdAKq2AToJg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=stefansf@linux.ibm.com \
    --cc=tdevries@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).