From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 31DFB3855599 for ; Thu, 4 May 2023 09:45:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31DFB3855599 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ac733b813fso3095681fa.1 for ; Thu, 04 May 2023 02:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683193547; x=1685785547; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vwxf68f6bWKLMHk2h7RHZuJ7zg47r1te+Rj14aaDwmo=; b=QPx9DLv0JHEXvvmtDu0M02fJVCRzisf84mkbLtR/DJnRNdwLNRFlq054jGOT1c35BU MruUgsmEm1HNQd9BJ3kQW51k54Wor0lWJAKz4Jhi6T1kF8/Wu1kcdXcudjRLNw4pE+oz b9UdpCRJ47s6RdxadjA6KsekaTAc+ydZwNULJahGdxXMwQONC6WVWaZ4TcTdW2swqXvV 0hxnEEnBkbETe+jnBnVKPaVhyT7Lv3jyklAoo+zhJClaiaHo9zk9GEwjwJ5NZ37LEpCx uutIaI2ISK9Kb4m2wRTnLRyp5YZqmAe+pK3RhcKowGFcVqYOS67+7+czcVd7oNYFbHi/ 85Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683193547; x=1685785547; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vwxf68f6bWKLMHk2h7RHZuJ7zg47r1te+Rj14aaDwmo=; b=MTVk7IyIKUJa6iKI7JIexzijFKknak2JLI+wR1INQefefdEBThlhHJ/EQ8hLmqew2j Vv0PbxURkY5MA0KOeSYEwlQaOQm1ehT6aUjiTbqC9VD96DUYGzDm55rql3TMdB9JCPIG UFLEUqPLTmmfPX05T5JoWPuqBkGRwa/LH2ifES0S7e9QL3KcSAJNzl45e3nSHw6304Dv UH/YC13gtNO4iIiq8hPz+yFu9eBfo7JsRBXPkrrAuOQXvEeUvgsE2L88HtGS+RZLTIWU JJWC+xxLg+16stlbLyfMWohQvjKP7iVdY8siIzC7pFDR6sOiJxF8CdYrmJPauKwqfzhV WfBA== X-Gm-Message-State: AC+VfDzT5c1EAJKfrWZBFD7zZvf+dR0T+7c9gW7FEzdax7SUKNeMFucn E4cInGdMhX+LuR45ng85zmse5gBj6cIwvbBAfGDGm7nw X-Google-Smtp-Source: ACHHUZ4Tg+woAlzgy8sVYERRhkLusFvO2d1XR96y7nNZ5lcs+ces3PQ5n9n+A0kJvw0tU7rLrdK0zo2qKCJqfBYAH1k= X-Received: by 2002:a2e:8816:0:b0:2a7:80f6:e50b with SMTP id x22-20020a2e8816000000b002a780f6e50bmr807845ljh.7.1683193546666; Thu, 04 May 2023 02:45:46 -0700 (PDT) MIME-Version: 1.0 References: <20230418175507.2C40B2040B@pchp3.se.axis.com> <0442F4ED-45A1-44D3-AB1B-F28657F04D3F@comcast.net> <20230418184412.95E632043B@pchp3.se.axis.com> <20230419031527.6D39120420@pchp3.se.axis.com> <20230419040627.9ED9820420@pchp3.se.axis.com> <20230419165914.6516820438@pchp3.se.axis.com> <20230426235524.7A13C20405@pchp3.se.axis.com> <20230504000925.DD5C320437@pchp3.se.axis.com> In-Reply-To: <20230504000925.DD5C320437@pchp3.se.axis.com> From: Richard Biener Date: Thu, 4 May 2023 11:45:34 +0200 Message-ID: Subject: Re: 2nd Ping: Re: [PATCH v3] doc: Document order of define_peephole2 scanning To: Hans-Peter Nilsson Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, May 4, 2023 at 2:10=E2=80=AFAM Hans-Peter Nilsson via Gcc-patches wrote: > > Ping again. OK. > > From: Hans-Peter Nilsson > > Date: Thu, 27 Apr 2023 01:55:24 +0200 > > > > > From: Hans-Peter Nilsson > > > Date: Wed, 19 Apr 2023 18:59:14 +0200 > > [...] > > > > > So again: Approvers: pdf output reviewed. Ok to commit? > > > -- >8 -- > > > I was a bit surprised when my newly-added define_peephole2 didn't > > > match, but it was because it was expected to partially match the > > > generated output of a previous define_peephole2, which matched and > > > modified the last insn of a sequence to be matched. I had assumed > > > that the algorithm backed-up the size of the match-buffer, thereby > > > exposing newly created opportunities *with sufficient context* to all > > > define_peephole2's. While things can change in that direction, let's > > > start with documenting the current state. > > > > > > * doc/md.texi (define_peephole2): Document order of scanning. > > > --- > > > gcc/doc/md.texi | 9 +++++++++ > > > 1 file changed, 9 insertions(+) > > > > > > diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi > > > index 07bf8bdebffb..300d104d58ab 100644 > > > --- a/gcc/doc/md.texi > > > +++ b/gcc/doc/md.texi > > > @@ -9362,6 +9362,15 @@ If the preparation falls through (invokes neit= her @code{DONE} nor > > > @code{FAIL}), then the @code{define_peephole2} uses the replacement > > > template. > > > > > > +Insns are scanned in forward order from beginning to end for each ba= sic > > > +block. Matches are attempted in order of @code{define_peephole2} > > > +appearance in the @file{md} file. After a successful replacement, > > > +scanning for further opportunities for @code{define_peephole2}, resu= mes > > > +with the first generated replacement insn as the first insn to be > > > +matched against all @code{define_peephole2}. For the example above, > > > +after its successful replacement, the first insn that can be matched= by > > > +a @code{define_peephole2} is @code{(set (match_dup 4) (match_dup 1))= }. > > > + > > > @end ifset > > > @ifset INTERNALS > > > @node Insn Attributes > > > -- > > > 2.30.2 > > > > >