From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 71FB7386100B; Wed, 14 Jul 2021 18:05:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71FB7386100B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 16EI4vFA030759; Wed, 14 Jul 2021 13:04:57 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 16EI4u0m030756; Wed, 14 Jul 2021 13:04:56 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 14 Jul 2021 13:04:56 -0500 From: Segher Boessenkool To: guojiufu Cc: rguenther@suse.de, amker.cheng@gmail.com, jlaw@tachyum.com, wschmidt@linux.ibm.com, gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, Gcc-patches Subject: Re: [PATCH V2] Use preferred mode for doloop iv [PR61837]. Message-ID: <20210714180456.GZ1583@gate.crashing.org> References: <20210713125046.144578-1-guojiufu@linux.ibm.com> <20210713205048.GT1583@gate.crashing.org> <60939ad4d5b10cbb98cee3cef84af042@imap.linux.ibm.com> <5a4756307d43eefb1c684c3f45697a02@imap.linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a4756307d43eefb1c684c3f45697a02@imap.linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 18:06:00 -0000 Hi! On Wed, Jul 14, 2021 at 06:26:28PM +0800, guojiufu wrote: > PR target/61837 Wrong PR number? > +@deftypefn {Target Hook} machine_mode TARGET_PREFERRED_DOLOOP_MODE > (machine_mode @var{mode}) > +This hook takes a @var{mode} which is the original mode of doloop IV. > +And if the target prefers other mode for doloop IV, this hook returns > the > +preferred mode. > +For example, on 64bit target, DImode may be preferred than SImode. > +This hook could return the original mode itself if the target prefer to > +keep the original mode. > +The origianl mode and return mode should be MODE_INT. > +@end deftypefn (Typo, "original"). That has all the right contents, but needs someone who is better at English than me to look at it / improve it. > +/* { dg-final {scan-rtl-dump-not "zero_extend.*doloop" "loop2_doloop"} > } */ > +/* { dg-final {scan-rtl-dump-not "reg:SI.*doloop" "loop2_doloop" { > target lp64 } } } */ (Don't use format=flowed in your mails, or certainly not in those containing patches -- it was rewrapped). If you use .* in scan REs, you should be aware that "." matches newlines by default, so you can match "reg:SI" on one line and "doloop" on a later one, in that second one. You can write /* { dg-final {scan-rtl-dump-not {(?p)reg:SI.*doloop} "loop2_doloop" { target lp64 } } } */ (note: {} are much more convenient around most REs, you need a lot of escaping without it) to get "partial newline-sensitive matching", which is usually what you want (see "man re_syntax" for the details). The generic changes look fine to me (but what do I know about Gimple!) The rs6000 changes are fine if the rest is approved (and see the testcase comments). Thanks! Segher