From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1011) id 066EE3858C36; Wed, 26 Apr 2023 19:25:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 066EE3858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682537157; bh=NrbR+7bgRRtq1xbKrbPNI004DRBjezW5DXjnyEEFIH8=; h=From:To:Subject:Date:From; b=jjVpNzwBt1MSsaEnqSOpfFCuxuWuvyxSe1wnaSfwCtjtP1Y55A4f3DLu99ZsCW/DY b2ti3EurshPOvG+EH63k0GFiRNbPpDNU4oX3FX+cfeV6nG+AkoOJ+OcSZHiCjOrcUf HK90x26riDKT5Znz1s4AOi8lXukl1N6OrzcknQAM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Macleod To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-272] Quicker relation check. X-Act-Checkin: gcc X-Git-Author: Andrew MacLeod X-Git-Refname: refs/heads/master X-Git-Oldrev: 40c7f943e882e8c5eccf45fc28146559f446764d X-Git-Newrev: bf50499a14943b64f19bd72c60422683f7ecd0ee Message-Id: <20230426192557.066EE3858C36@sourceware.org> Date: Wed, 26 Apr 2023 19:25:57 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bf50499a14943b64f19bd72c60422683f7ecd0ee commit r14-272-gbf50499a14943b64f19bd72c60422683f7ecd0ee Author: Andrew MacLeod Date: Wed Feb 8 12:36:23 2023 -0500 Quicker relation check. If either of the SSA names in a comparison do not have any equivalences or relations, we can short-circuit the check slightly. * value-relation.cc (dom_oracle::query_relation): Check early for lack of any relation. * value-relation.h (equiv_oracle::has_equiv_p): New. Diff: --- gcc/value-relation.cc | 6 ++++++ gcc/value-relation.h | 1 + 2 files changed, 7 insertions(+) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 30a02d3c9d3..65cf7694d40 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -1374,6 +1374,12 @@ dom_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) if (v1 == v2) return VREL_EQ; + // If v1 or v2 do not have any relations or equivalences, a partial + // equivalence is the only possibility. + if ((!bitmap_bit_p (m_relation_set, v1) && !has_equiv_p (v1)) + || (!bitmap_bit_p (m_relation_set, v2) && !has_equiv_p (v2))) + return partial_equiv (ssa1, ssa2); + // Check for equivalence first. They must be in each equivalency set. const_bitmap equiv1 = equiv_set (ssa1, bb); const_bitmap equiv2 = equiv_set (ssa2, bb); diff --git a/gcc/value-relation.h b/gcc/value-relation.h index 3177ecb1ad0..be6e277421b 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -170,6 +170,7 @@ public: void dump (FILE *f) const override; protected: + inline bool has_equiv_p (unsigned v) { return bitmap_bit_p (m_equiv_set, v); } bitmap_obstack m_bitmaps; struct obstack m_chain_obstack; private: