From patchwork Mon Jun 12 15:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1793965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=oD5CT+v4; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qfwfk0tXqz20QH for ; Tue, 13 Jun 2023 01:32:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C0803857C43 for ; Mon, 12 Jun 2023 15:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C0803857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686583948; bh=U8u3fezfNYyNbJNBTGJRLKfyLKVZo8Q5nnMrEdcz9CA=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oD5CT+v4L9DynyDnDuzoRCn6myiU8ItJNCgmkccisrvytagt9oBlK1mR1eZi4W2h8 dRu5liPoQvORi6dkU28bcV/nAZHOSJpWhewDxfbaUODxcEdls7uMEnwBPn+C6sa/RB 9lPv96uG5LivTX8j9GvOpSCnPzfVLrulcgJif7iE= 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 ESMTPS id D71D23858409 for ; Mon, 12 Jun 2023 15:32:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D71D23858409 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-btAbszrNNgyJ1f29pWp6CA-1; Mon, 12 Jun 2023 11:32:05 -0400 X-MC-Unique: btAbszrNNgyJ1f29pWp6CA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-3f9f1f27b13so11846771cf.1 for ; Mon, 12 Jun 2023 08:32:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686583924; x=1689175924; h=content-transfer-encoding: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=U8u3fezfNYyNbJNBTGJRLKfyLKVZo8Q5nnMrEdcz9CA=; b=fstb36gFG585Gr7/Ihxg+WysWJYgcrExvUrglmDQi8AVnnk0Yl0Wr4CuaSnE0gXxwk rLeP4IaGTXH/pSB5ACzF03SoSwcUNmzOUypRCAJcsHtZ9JTPY/E0y2K1wCWB+yVm5MgZ zHs6RwYC/H9o5uCYVUxjO4qI+cgaGoqRVrr1U4UPyQeoAP+dLzj/sXIp2T9ebpmQp91H QA+GNoeX1rcQycyqE6qta3vNd+bOC3M2WgJYsinRg2PTmgqaCveze3MXrAYgeg9i/g56 wpidWNgu1AU1NVQiNokSpYZqYXP67N1NUKSVMRTUmzH+FAqd4F9xF8qXZhDTnuq3gthF uE0g== X-Gm-Message-State: AC+VfDxFhF5A6S+fJbteMbah4eDVb6MJMPwOFPI8vUSsbIGdnFPFuDF0 CL2n/oucKtxK2euEvQasUGOUvOmQ0UXdn+eJY78IW1zP3OS3jhAlhIBf9dcxHPUNNbM0/mNjfzg RTj7mccI6jM/gADBegWqGtBRgZiOZw0QIWEsX/ACsLvSXShfvDm2+Aj0/heWWBkqmUFYakO8m0s gRmQ== X-Received: by 2002:a05:622a:386:b0:3f4:8612:6d84 with SMTP id j6-20020a05622a038600b003f486126d84mr9277800qtx.60.1686583924402; Mon, 12 Jun 2023 08:32:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BBsvrgDXqJt5mneSErgvoKNKqOQB9w8faEOr+7fpY12gWruNYIbSsiuQsxnO01xnFcymUnQ== X-Received: by 2002:a05:622a:386:b0:3f4:8612:6d84 with SMTP id j6-20020a05622a038600b003f486126d84mr9277780qtx.60.1686583923957; Mon, 12 Jun 2023 08:32:03 -0700 (PDT) Received: from ?IPV6:2607:fea8:51df:4200::ca58? ([2607:fea8:51df:4200::ca58]) by smtp.gmail.com with ESMTPSA id h26-20020ac8549a000000b003e4ee0f5234sm3480714qtq.87.2023.06.12.08.32.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 08:32:03 -0700 (PDT) Message-ID: <0acc23cb-7356-3544-990c-2f6ce5b5372a@redhat.com> Date: Mon, 12 Jun 2023 11:31:57 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: gcc-patches Cc: "hernandez, aldy" Subject: [COMMITTED 0/17] - Range-op dispatch unification rework X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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-Patchwork-Original-From: Andrew MacLeod via Gcc-patches From: Andrew MacLeod Reply-To: Andrew MacLeod Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch set completes the range-op dispatch and unification rework. The first 7 patches move the remainder of the integral table to the unified table, and remove the integer table. The 8th patch moves all the pointer specific code into a new file range-op-ptr.cc Patches 9-12 introduce a "hybrid" operator class for the 4 operations which pointers and integer share a TREE_CODE, but have different implementations.  And extra hybrid class is introduced in the pointer file which inherits from the integer version, and adds new overloads for the used methods which look sa tthe type being passed in and does the dispatcxh itself to either the inherited integer version, or call the pointer version opcode. This allows us to have a unified entry for those 4 operators (BIT_AND_EXPR, BIT_IOR_EXPR, MIN_EXPR, and MAX_EXPR) and move on.   WHen we introduce a pointer range type (ie PRANGE), we can simply add the prange signature to the appropriate range_operator methods, and remove the pointer and hybrid classes.  patch 13 thru 16 does some tweaking to range_op_handler and hows its used. It now provides a default operator under the covers, so you no longer need to check if its valid.   The valid check now simply indicates if its has a custom operator implemented or not. This means you can simply write: if (range_op_handler (CONVERT_EXPR).fold_range (...  )) without worrying about whether there is an entry.  If there is no CONVERT_EXPR implemented, you'll simple get false back from all the calls. Combined with the previous work, it is now always safe to call any range_operator routine via range_op_handler with any set of types for vrange parameters (including unsupported types)  on any tree code, and you will simply get false back if it isn't implemented. Andrew