From patchwork Fri Nov 1 19:25:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 100054 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A4163857C68 for ; Fri, 1 Nov 2024 19:26:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id C5A35385840C for ; Fri, 1 Nov 2024 19:25:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5A35385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C5A35385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489124; cv=none; b=xDrzy1klTQ93p5lo+XXFMWpfvMU1goG2UpeoY3gQJGKH9aC1Gr0IYvXyHAMZjktwJ0whSXO+fP3KJOe5mrj6m5ZodP/+NX2I32EOToNYaHmhqq1WpfJ74gO66yzWmPvBWl7T/FwbtRh3JlBIPU07O8uERiXidsJ9bBZiouoEpsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730489124; c=relaxed/simple; bh=yubYcxPYWx7WFIVOq7vVkYSBDYcm1SrSvtGP3p3HbjY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=WGnEaJHFH30vdvEOFGJqMDdZrOTL0RUKlaXwVXw83JnYDkji09npHJV5mK16FX9IyTP0bPzF8AXtiZNbZloaYwMVwxjd9OxgO3Nv1gWkGbKgcTQAd2/ayvUOfJeqphqS2awBBMeJjfuXHXXwBqs7oKrlsk5K1xiGEC3hXDCqaGI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730489118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=ueIVIwhHm7gmGdzsnN53/ThLo7DMdU8FizzhSct090s=; b=KawtJgTGXb80bCyO4vQtz1dRobpDB75Aj4zHqiCiToZsR74mKI6ha79ezg8ddq1t4EZam8 tkggbYaeuOL7uDdDsPS6ErLKUnBpT/EWsSn74IAHAMhkK5uoDj4srzCGt5fL+QyEO8k/ia rsnSzFC6idey5KzK9skj/W9GCj3wHlo= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-sW_SrykoN7yJdJcT3oNy1w-1; Fri, 01 Nov 2024 15:25:16 -0400 X-MC-Unique: sW_SrykoN7yJdJcT3oNy1w-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6ce23cf761bso35997376d6.3 for ; Fri, 01 Nov 2024 12:25:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730489115; x=1731093915; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Am5PQCL30Y00hU0yBRj8Oh+jD/rQ3+cJaZqL6bJclvw=; b=hayDT6Vfo9PhbZl+6hyCzGpu3Odep9BAHod+55G0ZBn+o4sZxK6kZFQOoNeIOI2q8d qH9+E9VrDgkU4TAm5UZq+Gws3ZYnsppQC1TUTlq2MboT9tFEmy2uFBTBYrGq6eUhMXut cCeVIkf2Sw3Muu58p7w0CiJfyeF7kjDN+cn5chDnLJc989+v6mUXjqiWsuWFCtuuMdOO g5bKQaakLVbbx7ptJsSe3nlLUM5igkpas0/XltWk4G5fKnJRSS3/nZD4DLhSaCrqYQKf uHUqFIgdBjQ8NKBohyEjlIt6FnFB3N8rlazj6yMZt6JLV99sYl9Bo8aQW7NYPJLQRL1v dDjw== X-Gm-Message-State: AOJu0YwtdW9TYFglXS/zPDVRxislxaafxGbUJgtLjiOYOSdR68H1V00t WnoxnVNgQVjBZypu0+plkjeklXEFZsLx70nMRWiVEwT9bCdSnw6xrIO8U4NxTThLHKCmGQkAZlL s+Ga1abB03jDvq1ea2C1kFvhRZjpWAwr1jJZLKjteCce1fdaBa+s0pRmHI/0uj7GPAWAujA2hqm 1jlw2oTHmFHSQJ0yu9UnvuHvRj1f6wmX9eN44baScgbA== X-Received: by 2002:a05:6214:319f:b0:6d3:535e:70ab with SMTP id 6a1803df08f44-6d3535e7250mr111016946d6.17.1730489115247; Fri, 01 Nov 2024 12:25:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFubNytcbO+In6yZdi8Nlh3FNPNKX6p1Kv/yhv+unn3lYfjqXuVRTYhkgIkwgWLzcJbDZg1UA== X-Received: by 2002:a05:6214:319f:b0:6d3:535e:70ab with SMTP id 6a1803df08f44-6d3535e7250mr111016606d6.17.1730489114704; Fri, 01 Nov 2024 12:25:14 -0700 (PDT) Received: from ?IPV6:2607:fea8:51de:a700::c2e1? ([2607:fea8:51de:a700::c2e1]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d35417a3c5sm22211646d6.130.2024.11.01.12.25.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Nov 2024 12:25:13 -0700 (PDT) Message-ID: Date: Fri, 1 Nov 2024 15:25:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: gcc-patches From: Andrew MacLeod Subject: [COMMITTED 1/3] Make fur_edge accessible. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The next patch requires a fur_edge class.  It needs to calculate ranges on both edges and statements, and this provides a way to do both without having different routines. This patch simply moves it out of the source file and into gimple-range-fold.h where it is generally accessible. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 548a78d0e4c02f1e5d07c8812d4324fef581d14b Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 31 Oct 2024 15:44:15 -0400 Subject: [PATCH 1/3] Make fur_edge accessible. Move the decl of fur_edge out of the source file into the header file. * gimple-range-fold.cc (class fur_edge): Relocate from here. (fur_edge::fur_edge): Also move to: * gimple-range-fold.h (class fur_edge): Relocate to here. (fur_edge::fur_edge): Likewise. --- gcc/gimple-range-fold.cc | 20 -------------------- gcc/gimple-range-fold.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 82dd363f2ec..a4063b718f6 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -109,26 +109,6 @@ fur_source::register_relation (edge e ATTRIBUTE_UNUSED, { } -// This version of fur_source will pick a range up off an edge. - -class fur_edge : public fur_source -{ -public: - fur_edge (edge e, range_query *q = NULL); - virtual bool get_operand (vrange &r, tree expr) override; - virtual bool get_phi_operand (vrange &r, tree expr, edge e) override; -private: - edge m_edge; -}; - -// Instantiate an edge based fur_source. - -inline -fur_edge::fur_edge (edge e, range_query *q) : fur_source (q) -{ - m_edge = e; -} - // Get the value of EXPR on edge m_edge. bool diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h index 37c49596c33..109510853a2 100644 --- a/gcc/gimple-range-fold.h +++ b/gcc/gimple-range-fold.h @@ -150,6 +150,20 @@ public: tree op2) override; }; + +// This version of fur_source will pick a range up off an edge. + +class fur_edge : public fur_source +{ +public: + fur_edge (edge e, range_query *q = NULL) : fur_source (q) + { m_edge = e; } + virtual bool get_operand (vrange &r, tree expr) override; + virtual bool get_phi_operand (vrange &r, tree expr, edge e) override; +private: + edge m_edge; +}; + // This class uses ranges to fold a gimple statement producing a range for // the LHS. The source of all operands is supplied via the fur_source class // which provides a range_query as well as a source location and any other -- 2.45.0