From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id DE703386CE6D for ; Tue, 14 Jun 2022 01:24:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE703386CE6D Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-470-aWAqkStlNJ-Q9nlMiHglKA-1; Mon, 13 Jun 2022 21:24:36 -0400 X-MC-Unique: aWAqkStlNJ-Q9nlMiHglKA-1 Received: by mail-qt1-f197.google.com with SMTP id a6-20020ac81086000000b002f65fd83048so5585807qtj.6 for ; Mon, 13 Jun 2022 18:24:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=6aRAPk9xIew10yCaS/bH30DEkUQgL0R+FjRGi/3GQqQ=; b=dHyYDLbv/lVB6ua4gQqqQmFoF57zapKwFv4MEoOhotaeBtbTKY7EIV1kktovxEZirU wi1ZbMEUU3yBFHu1zHhaAOEbGY+KbgKSiZnvMyuYQLpvBF7Pk2g42ygE6jyhpOV6Bw6n AiYFxcjqVy3jJn130gVN7FaXht1mfvrPnCfNLkrSEj0mQbiLKlDkxQ2A/b1x4m7hoisM XK4YvZxIlNPQQEWr382rB12jdrjCiIuB1+B8yi52yqWjytnkc80j+RrLCh4k4dOZkMJg WF1OhcxsQEDEzcQnrwmxxMzDabs15Yd7QoaUldY1MmaGX16/lLm3fFgnmQdsedjrFEXP XF5w== X-Gm-Message-State: AOAM531s/yytLp2MtYxO6QGmM1JxCWzCOi3njRCF8l6m0vn7SslSGOIf 6T8jDwphHYou1b3iZAwT9H/RGFPBPjyVQi7IX5rUsVWvzu3WcGmljCukgRuS2GHBwCsIx10Nmvl aK4C562WANAo0Md1MMg== X-Received: by 2002:a05:620a:1306:b0:6a6:b06c:c718 with SMTP id o6-20020a05620a130600b006a6b06cc718mr2182359qkj.695.1655169876137; Mon, 13 Jun 2022 18:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJQGad+3xhfj4p7zutf5aTfHD1QgQ64GeTxSMxRVffJUA8+EkH9HczC1fLgWav51tco1msCg== X-Received: by 2002:a05:620a:1306:b0:6a6:b06c:c718 with SMTP id o6-20020a05620a130600b006a6b06cc718mr2182350qkj.695.1655169875885; Mon, 13 Jun 2022 18:24:35 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id d3-20020a05620a240300b006a6a1e4aec2sm8197676qkn.49.2022.06.13.18.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 18:24:35 -0700 (PDT) Message-ID: <8d3e4e47a6bf2905b1a806234423c2eabd2d546b.camel@redhat.com> Subject: Re: PING Re: [PATCH 07/10] value-relation.h: add 'final' and 'override' to relation_oracle vfunc impls From: David Malcolm To: Aldy Hernandez Cc: gcc-patches , Andrew MacLeod Date: Mon, 13 Jun 2022 21:24:34 -0400 In-Reply-To: References: <20220523192834.3785673-1-dmalcolm@redhat.com> <20220523192834.3785673-8-dmalcolm@redhat.com> <2edbd394896697ef6c72c3203a2fd22ecdb637fb.camel@redhat.com> User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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 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: Tue, 14 Jun 2022 01:24:40 -0000 On Mon, 2022-06-13 at 20:45 -0400, Aldy Hernandez wrote: > Final implies we can't further derive from the derived class, right? "final" on a vfunc implies that nothing overrides that vfunc, but you could still have further derived classes. You can think of it as "nothing further overrides this vfunc", as both a hint to the human reader, and an optimization hint to the compiler.   You can always just remove the "final" if you want to override it in the future (unless the override is happening in a plugin, I suppose). > If so > we may want just override. "override" is indeed probably more useful, in that it documents to compilers and human readers that you intend this to override a vfunc. FWIW I wrote the patch by using both "final" and "override", and then dropping the "final" everywhere I needed to to get it to compile. Dave > > Andrew, what are your thoughts? > > Thanks for doing this. > > Aldy > > On Mon, Jun 13, 2022, 14:28 David Malcolm wrote: > > > Ping re this patch: > >   https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595438.html > > > > OK for trunk? > > > > Thanks > > Dave > > > > > > On Mon, 2022-05-23 at 15:28 -0400, David Malcolm wrote: > > > gcc/ChangeLog: > > >         * value-relation.h: Add "final" and "override" to > > > relation_oracle > > >         vfunc implementations as appropriate. > > > > > > Signed-off-by: David Malcolm > > > --- > > >  gcc/value-relation.h | 38 +++++++++++++++++++++----------------- > > >  1 file changed, 21 insertions(+), 17 deletions(-) > > > > > > diff --git a/gcc/value-relation.h b/gcc/value-relation.h > > > index 19762d8ce2b..478729be0bf 100644 > > > --- a/gcc/value-relation.h > > > +++ b/gcc/value-relation.h > > > @@ -130,14 +130,15 @@ public: > > >    equiv_oracle (); > > >    ~equiv_oracle (); > > > > > > -  const_bitmap equiv_set (tree ssa, basic_block bb); > > > +  const_bitmap equiv_set (tree ssa, basic_block bb) final > > > override; > > >    void register_relation (basic_block bb, relation_kind k, tree > > > ssa1, > > > -                         tree ssa2); > > > +                         tree ssa2) override; > > > > > > -  relation_kind query_relation (basic_block, tree, tree); > > > -  relation_kind query_relation (basic_block, const_bitmap, > > > const_bitmap); > > > -  void dump (FILE *f, basic_block bb) const; > > > -  void dump (FILE *f) const; > > > +  relation_kind query_relation (basic_block, tree, tree) override; > > > +  relation_kind query_relation (basic_block, const_bitmap, > > > const_bitmap) > > > +    override; > > > +  void dump (FILE *f, basic_block bb) const override; > > > +  void dump (FILE *f) const override; > > > > > >  protected: > > >    bitmap_obstack m_bitmaps; > > > @@ -185,14 +186,16 @@ public: > > >    dom_oracle (); > > >    ~dom_oracle (); > > > > > > -  void register_relation (basic_block bb, relation_kind k, tree > > > op1, > > > tree op2); > > > +  void register_relation (basic_block bb, relation_kind k, tree > > > op1, > > > tree op2) > > > +    final override; > > > > > > -  relation_kind query_relation (basic_block bb, tree ssa1, tree > > > ssa2); > > > +  relation_kind query_relation (basic_block bb, tree ssa1, tree > > > ssa2) > > > +    final override; > > >    relation_kind query_relation (basic_block bb, const_bitmap b1, > > > -                                  const_bitmap b2); > > > +                               const_bitmap b2) final override; > > > > > > -  void dump (FILE *f, basic_block bb) const; > > > -  void dump (FILE *f) const; > > > +  void dump (FILE *f, basic_block bb) const final override; > > > +  void dump (FILE *f) const final override; > > >  private: > > >    bitmap m_tmp, m_tmp2; > > >    bitmap m_relation_set;  // Index by ssa-name. True if a relation > > > exists > > > @@ -229,15 +232,16 @@ class path_oracle : public relation_oracle > > >  public: > > >    path_oracle (relation_oracle *oracle = NULL); > > >    ~path_oracle (); > > > -  const_bitmap equiv_set (tree, basic_block); > > > -  void register_relation (basic_block, relation_kind, tree, tree); > > > +  const_bitmap equiv_set (tree, basic_block) final override; > > > +  void register_relation (basic_block, relation_kind, tree, tree) > > > final override; > > >    void killing_def (tree); > > > -  relation_kind query_relation (basic_block, tree, tree); > > > -  relation_kind query_relation (basic_block, const_bitmap, > > > const_bitmap); > > > +  relation_kind query_relation (basic_block, tree, tree) final > > > override; > > > +  relation_kind query_relation (basic_block, const_bitmap, > > > const_bitmap) > > > +    final override; > > >    void reset_path (); > > >    void set_root_oracle (relation_oracle *oracle) { m_root = > > > oracle; } > > > -  void dump (FILE *, basic_block) const; > > > -  void dump (FILE *) const; > > > +  void dump (FILE *, basic_block) const final override; > > > +  void dump (FILE *) const final override; > > >  private: > > >    void register_equiv (basic_block bb, tree ssa1, tree ssa2); > > >    equiv_chain m_equiv; > > > > > >