From patchwork Mon Nov 4 14:42:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 2006279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e332+DAX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XhvNF6KGdz1xwF for ; Tue, 5 Nov 2024 01:43:25 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E20CB3857BA9 for ; Mon, 4 Nov 2024 14:43:23 +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.129.124]) by sourceware.org (Postfix) with ESMTP id 9C6513857830 for ; Mon, 4 Nov 2024 14:42:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C6513857830 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 9C6513857830 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730731342; cv=none; b=qPszDWJ/INZjwhFkjGVFOo5CdXSaC9jUPBFfBnSLHeoIV+fgTZrSmvukGrVDA6G0+1Bu4Se+8MeF2y1RU00/6pJ6VmLYSTGLsi9ZCkFXMZLf6hVoDy7VRmmrVpOKz3RwgWEDpUMb1IoKe2mR+ZXSI/flxAeorfhmqWwoV0aMry0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730731342; c=relaxed/simple; bh=bTl5B6++Op5lvViKX1npu3qrgiufc+gMvgaGZoEcqyM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=U6gnmjcA0qtoZyCH6XhIi8uOWSN0vedFrtr8d/MHZ+WBxjKqcFMOTvIrbVPCu5vbpuf2utElfyXuX2+Zrd7tLQoMH4GCy7bWHdPIdpIgaVdNyGcmiM7sVMjx+bM0YliN2TxqU5VlyH0GbJSltqx5VJsbQxDC9DEQqZqPB57uejM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730731337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=ZHxTALrwCI91g1l4ei6X3zCppChcfwOvtWv8c8YyNxA=; b=e332+DAXsXA3Zv9VL2nHZr9ZBhxhhxc8n8S+UPV9pwERfcZb1bzkVwmaBdcr/5l/8m0UjC ZOFvuf0OIz1tbDTc0HthbfhHB7YV2L1c5ywNeP0ZnFFNkK1vw/4KLpja5fjwONsSaw9WuJ NMC163L1Cw3QhoqRhM9SL7fbIMKmhl0= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-jThk4J8_Oy2NrODLLarpxg-1; Mon, 04 Nov 2024 09:42:15 -0500 X-MC-Unique: jThk4J8_Oy2NrODLLarpxg-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6d35a060aa5so68554366d6.1 for ; Mon, 04 Nov 2024 06:42:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730731334; x=1731336134; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bMBQNzqUcYeWCiw/N4Zor6xbyyc25L4Hn0Hbq3RwnTw=; b=Cn2Hpd63HRDcGVjHB/P3kLAGnZk72pywb3f+VqOycJtr3SxtCTak7M3WG7f2u0d4kd Kpn5yh+BfOgXa3w3u1F+HRjmDBaXrGm+SMgYeOoPP8CaqWdshy/FsbD8IjCHZNEUNlKX V+8w0TNo0JmG/flRIJh8hO+rXAR2MEu+3ZpXkWNIpxc0DpZWnG9ZIh8Qymm5mt6k6H5e XadchlrSrENY2gpv2+oJynb1irmBnqkoC9bPb0oIHVTeOai/LvzonwO2hLTF6CjAhF6D 95/bgjIiYvkS57XQQo+Foy9HRJNtSU+LShU4D9SZ5G9Dw96PBI18ZQq1xdnKc+EFnUWj 1Xhg== X-Gm-Message-State: AOJu0Yyr/klWz72YrOzhU6PHbK9fXQcVQ/p5mwZkOrRHSGz7e9zEMQLW sqr7w54hLwCczswhKju01cO57f0dLei4BQVnqn8H3qiagtGAc7aop2AecsSzlc5+Vs8Ei0SqD9M MHDhUsTTNPLHYL+ypB9gyYKCdw5EXd4S4vodkL3KQqPwWULkyxjwbePnvXtH+m0Dp6BKH7e56+t +dn3P8ssH7pXC3gGeampB9zIIDW/91bldfvDyYSart/g== X-Received: by 2002:a05:6214:5710:b0:6cd:ac54:7995 with SMTP id 6a1803df08f44-6d351b208c5mr211266926d6.36.1730731334049; Mon, 04 Nov 2024 06:42:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/Uh7WoG+yrAZ7e+F2aT1JyXpknE+QC5l3jSlH/2yi29lKGRDSyiPNbPHtdOfqvkcosyQ35Q== X-Received: by 2002:a05:6214:5710:b0:6cd:ac54:7995 with SMTP id 6a1803df08f44-6d351b208c5mr211266626d6.36.1730731333525; Mon, 04 Nov 2024 06:42:13 -0800 (PST) Received: from ?IPV6:2607:fea8:51de:a700::c2e1? ([2607:fea8:51de:a700::c2e1]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d35415b2c8sm48697526d6.84.2024.11.04.06.42.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Nov 2024 06:42:12 -0800 (PST) Message-ID: <92a4fa0a-70d8-4ece-91ee-94972872176f@redhat.com> Date: Mon, 4 Nov 2024 09:42:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: gcc-patches Cc: Jakub Jelinek From: Andrew MacLeod Subject: [COMMITTED] [GCC14] Implement new assume pass. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US 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~incoming=patchwork.ozlabs.org@gcc.gnu.org I've back ported and committed the 3 patch set for assume p;rocessing to GCC14.  The new file is almost the same, just a couple of minor differences related to  1) value_range in gcc15 was Value_Range in gcc14, and   2) there was no gori() component to a range_query, so I had to pass a ranger instance into the assume pass to access gori. Other than that, they are pretty much in sync. Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed. Andrew From 4e8c8eed82e190f5f819e75088d8e05a851b41e7 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 1 Nov 2024 10:56:54 -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 9c4ad1ee7b9..8020a1a3c63 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -108,26 +108,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 7cbe15d05e5..a619a530769 100644 --- a/gcc/gimple-range-fold.h +++ b/gcc/gimple-range-fold.h @@ -142,6 +142,20 @@ protected: relation_oracle *m_oracle; }; + +// 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