From patchwork Tue Feb 22 16:39:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1596251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=rCiUfyij; dkim-atps=neutral Authentication-Results: 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=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K34f46F3bz9sG2 for ; Wed, 23 Feb 2022 03:40:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1A793898C6F for ; Tue, 22 Feb 2022 16:40:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1A793898C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1645548007; bh=TRgSXCZmrR4+mjcuQ05HUkpgKk/I4K8c/rthBkx18Jw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rCiUfyij4ANRyQEVdarr9VHqXMw+X00qahByJ7opHlGUlaUYVByt3tfRNAVtgly+v 9o/Rf8qCa7W00gONB/lXHo+KYCnrVV1vEtoX7nPsuUgesizEu/goBjPMAQ18VT+pH1 ef5bf/IkLjahCC8fFD85ytnfHihHkgnHXniiyi80= 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 ESMTPS id 3A9393857817 for ; Tue, 22 Feb 2022 16:39:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A9393857817 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-vBqmbEbrMYeSw9G35nVgWQ-1; Tue, 22 Feb 2022 11:39:45 -0500 X-MC-Unique: vBqmbEbrMYeSw9G35nVgWQ-1 Received: by mail-qv1-f72.google.com with SMTP id s8-20020ad45008000000b004325198c76bso90033qvo.19 for ; Tue, 22 Feb 2022 08:39:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:cc:content-transfer-encoding; bh=TRgSXCZmrR4+mjcuQ05HUkpgKk/I4K8c/rthBkx18Jw=; b=Xgzx/8eRcGb63nEt28x51QD8YBcI5GDt1/j22d+ACJ59l1Q08fjaVgKMjEXO+R9ZSA SELsRXUw2OyJFF4I7/++TChPmuAJNfTrPY/o85rPHMC5Z1FXOOIJe0VDqjS3s0Z+3g0E DuDCyro4TXqa36GoEgLqUesw49R5PTBexsTk22KuVKYSzFW50UG6V4nluZ1o0VJmXWOT l0Lg54K0ecLBx0Ugkrf2AyHsgGaWlQRnRDZoH2gxMxEer8r1ddZlT2B6Y/xREWT3B6u8 tofUuOq7/U7/bU8Ii4kWccwRqZCh0vW4DT/7uwAVUmjSgFfu85X4h5syVKbtxPLmKVu5 owkA== X-Gm-Message-State: AOAM530pwyC8NZltykifS42fEcQT70T5uYcf3pUTLXiQU8l4QEOVW+WQ RQP7oiwlx2Zu4WgGlItXXk+XHyF1qODrJPyXYaunXs1FjGDxZJc4o4qSMf5pRKo6Cq7M4KroykI jQUIoFW4ldmCU2tdgV+FFHoPizlA1B5uFeJ4Wv4yIfPsKXsZuICjZSCdOwqIT3yAigTvmYw== X-Received: by 2002:a05:622a:155:b0:2de:466:ad1d with SMTP id v21-20020a05622a015500b002de0466ad1dmr12534466qtw.246.1645547984512; Tue, 22 Feb 2022 08:39:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQmBfJrY13dZAbNy1PqlgW4OjxX+hAyHqKgeMkYgUAIrT7/lEASfTPt8QT5Tv8yDOFgL62KQ== X-Received: by 2002:a05:622a:155:b0:2de:466:ad1d with SMTP id v21-20020a05622a015500b002de0466ad1dmr12534440qtw.246.1645547984237; Tue, 22 Feb 2022 08:39:44 -0800 (PST) Received: from ?IPV6:2607:fea8:a262:5f00::9b6f? ([2607:fea8:a262:5f00::9b6f]) by smtp.gmail.com with ESMTPSA id m1sm89324qkn.19.2022.02.22.08.39.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Feb 2022 08:39:43 -0800 (PST) Message-ID: Date: Tue, 22 Feb 2022 11:39:41 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 To: gcc-patches Subject: [PATCH 0/2] tree-optimization/104530 - proposed re-evaluation. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-CA 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_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" I'd like to get clarification on some subtle terminology. I find I am conflating calls that don't return with calls that may throw, and I think they have different considerations. My experiments with calls that can throw indicate that they always end a basic block.  This makes sense to me as there is the outgoing fall-thru edge and an outgoing EH edge.  Are there any conditions under which this is not the case? (other than non-call exceptions) If that supposition is true, that leaves us with calls in the middle of the block which may not return.  This prevents us from allowing later calculations from impacting anything which happens before the call. I believe the following 2 small patches could then resolve this.  1 - Export global names to SSA_NAME_RANGE_INFO during the statement walk instead of at the end of the pass  2 - Use the existing lazy recomputation machinery to recompute any globals which are defined in the block where a dependent value becomes non-null. More details in each patch.  Neither is very large.  We could add this to this release or wait for stage 1. Andrew