From patchwork Tue Jan 11 19:48:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1578673 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=qTYEDfvG; 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 (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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JYLqR0j2cz9s0r for ; Wed, 12 Jan 2022 06:49:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2BA453939C2A for ; Tue, 11 Jan 2022 19:49:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BA453939C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1641930543; bh=lDtuWTlNwxmRs6I/zMnf3i/gh5Zk8IXcQrvf7jgYuPc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qTYEDfvGzVeL10j7B+I9ebaL+UEeHbbc2l7dP3GTNeYbq5Yn7R3Wv0t6itv1L5raw nDwD/5hAgtioVFgF/dz3LbyOiLyew3uf47A5JBHnBO/9zYiTpCBpuUhVc5+96uwSbr vh1kA6QT4VXXUSr78Kojxph3j2YfSgP8NFajj/K8= 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 6E7323939C12 for ; Tue, 11 Jan 2022 19:48:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E7323939C12 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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-25-SqKvGD7eMDKpk8c37NI9Tg-1; Tue, 11 Jan 2022 14:48:40 -0500 X-MC-Unique: SqKvGD7eMDKpk8c37NI9Tg-1 Received: by mail-qv1-f69.google.com with SMTP id jv3-20020a05621429e300b0041696de044bso396614qvb.14 for ; Tue, 11 Jan 2022 11:48:40 -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:cc:from:subject; bh=ghlOP4mF2u0dL85bTT+s1e96ko7faa/8+sbDIDHn3N0=; b=YOqJ86BB5nvcH0lJijHsD6ZxFks2XSbBRupLjdIqpPQ+4lY3dskBE0aC4d4PEqCUq8 KaEZGvWNyHJZBojwHh6UDpe1vfKJtLKR5n4ee0zOmIVJjQm9l7bqvVY3oKvf0SXm+fcD 65oGYnE3rewsgtPKZGk/tangg3HCkdPUYF7Qe6S++TOAEzU86DdKG1HGJb0LqWXoLuRD P8POpC9UNTRIJRUSaLso/UH/ZrL9fBImh0J7oikkublCvWkGkZ6O5uvUgB8QJb6PjuxO lEAUgSpsCz5hFgVb6OC4TK6PcKQBiC2rLbkaogoLeVFMJ2qPlNlluOhE69TmuiRO3iKl lCwA== X-Gm-Message-State: AOAM533MOQdrh0XrNrDZrbzSX1l7ahFzlmHu+1cYuX5VHjjSei1BhTdw JIEmDAkX41N0Jeyj7TSpcO/OaAjlWJKnS6wcfEuNUIRUyaZ6C/SfnVa39XlnHd8tLT4UX1x2XPi qAwNVdHWQ1u8PfRDPJtDXB+Azw2uIKZAbCFYxkdfUaTAU4EB4RhMjxBT+zU8elwXTky+agw== X-Received: by 2002:a05:622a:20e:: with SMTP id b14mr5146235qtx.288.1641930519958; Tue, 11 Jan 2022 11:48:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUt/ixspxSLhSFc2JlomC5VeVHET+eca/yO7J2wav+9cPAehqZjkAqaFT4muHPcb06Y+Ujig== X-Received: by 2002:a05:622a:20e:: with SMTP id b14mr5146208qtx.288.1641930519454; Tue, 11 Jan 2022 11:48:39 -0800 (PST) Received: from ?IPV6:2607:fea8:a262:5f00:e36d:32da:80f:d4e1? ([2607:fea8:a262:5f00:e36d:32da:80f:d4e1]) by smtp.gmail.com with ESMTPSA id g5sm7597935qtb.97.2022.01.11.11.48.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jan 2022 11:48:39 -0800 (PST) Message-ID: <5d69d8fd-03c0-07e2-1031-41ed502fcee0@redhat.com> Date: Tue, 11 Jan 2022 14:48:37 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 To: gcc-patches Subject: [PATCH] tree-optimization/103551 - Always set EDGE_EXECUTABLE in ranger vrp. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-CA X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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 Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The simplify_and_fold engine uses the EDGE_EXECUTABLE flag to eliminate branches: substitute_and_fold_dom_walker::before_dom_children:      if (gimple_code (stmt) == GIMPLE_COND)         {           if ((EDGE_SUCC (bb, 0)->flags & EDGE_EXECUTABLE)               ^ (EDGE_SUCC (bb, 1)->flags & EDGE_EXECUTABLE)) ... but if certain passes before VRP2 are turned off, the flag can be in an uninitialized state upon entry to VRP2.  This patch simply always sets EDGE_EXECUTABLE on all edges before invoking ranger and the S&F engine. Bootstraps on  x86_64-pc-linux-gnu with no regressions. OK for trunk? Andrew commit 09934a28871701f3cef5175c2a510cd09ec13836 Author: Andrew MacLeod Date: Tue Jan 11 09:59:21 2022 -0500 Always set EDGE_EXECUTABLE in VRP2. PR tree-optimization/103551 * tree-vrp.c (execute_ranger_vrp): Always set EDGE_EXECUTABLE. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 804f3171ccc..62946450b13 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4332,6 +4332,7 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p) scev_initialize (); calculate_dominance_info (CDI_DOMINATORS); + set_all_edges_as_executable (fun); gimple_ranger *ranger = enable_ranger (fun); rvrp_folder folder (ranger); folder.substitute_and_fold ();