From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 7CB50385843D for ; Tue, 28 Sep 2021 06:28:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CB50385843D Received: by mail-pg1-x52f.google.com with SMTP id 75so3739455pga.3 for ; Mon, 27 Sep 2021 23:28:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=KaEnAtBbKnru0xZ8oUCsAkYMfdxUvsWjDqFzs3TTU/Y=; b=QokBKc6DkONP2Ig3IlLCXho7bqWdj9tJWBtdFQnkPaar+tfAvP5R0VQHgrv+JYmikj FCVkFHa+Mhwn/+Sf40nCNrhY+Zlj7BPTzV7p3YKTn8HcPQ1eQVTw6PE3fMGij+mqaJFU pZi0zzQaBBAduzpWiBd/fPIIdxWNXvab0aSuT3H9VaF4R5204zJ4i4aVGIsxqAgRxMHE 1hABxx2O6lONCZi7CJrxjqyTcmHcOcgxtEwGU2E+gHDUVw3wHg6vw8JgTeG9guA63Os8 djQVkEMh8rIXQ/xhYcjkq2kcX/8bi0BKePcm/33pY0XO2Uyv6jv+VALBkG7Ote1i9bjF XNsg== X-Gm-Message-State: AOAM531xM9Fkuw+jTKXYo16bhQK/fMDOAl8scdSkt7MwkR6aKYZ4JdXT RXFb7AAQ8h49suikw/zYhe0= X-Google-Smtp-Source: ABdhPJwl5R4CNq218z2JKq19LjBd6dk+PpYSBBBFSSUVHQeUTnJjRCgVXxg0Ytln9gGPxdxsQ5COSg== X-Received: by 2002:aa7:9499:0:b0:445:1c9c:3c1b with SMTP id z25-20020aa79499000000b004451c9c3c1bmr3741148pfk.8.1632810499330; Mon, 27 Sep 2021 23:28:19 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id t5sm1271379pji.1.2021.09.27.23.28.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Sep 2021 23:28:19 -0700 (PDT) Subject: Re: [PATCH] Control all jump threading passes with -fjump-threads. To: Aldy Hernandez Cc: GCC patches , Andrew MacLeod References: <20210927150003.796951-1-aldyh@redhat.com> <7ea0e648-1456-8c9f-1d26-83cd149fc2d3@gmail.com> From: Jeff Law Message-ID: <0c1d857c-6d17-6f91-6aa7-4af1a8391ec8@gmail.com> Date: Tue, 28 Sep 2021 00:28:17 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Tue, 28 Sep 2021 06:28:22 -0000 On 9/28/2021 12:17 AM, Aldy Hernandez wrote: > On Tue, Sep 28, 2021 at 3:46 AM Jeff Law wrote: >> >> >> On 9/27/2021 9:00 AM, Aldy Hernandez wrote: >>> Last year I mentioned that -fthread-jumps was being ignored by the >>> majority of our jump threading passes, and Jeff said he'd be in favor >>> of fixing this. >>> >>> This patch remedies the situation, but it does change existing behavior. >>> Currently -fthread-jumps is only enabled for -O2, -O3, and -Os. This >>> means that even if we restricted all jump threading passes with >>> -fthread-jumps, DOM jump threading would still seep through since it >>> runs at -O1. >>> >>> I propose this patch, but it does mean that DOM jump threading would >>> have to be explicitly enabled with -O1 -fthread-jumps. An >>> alternative would be to also offer a specific -fno-dom-threading, but >>> that seems icky. >>> >>> OK pending tests? >>> >>> gcc/ChangeLog: >>> >>> * tree-ssa-threadbackward.c (pass_thread_jumps::gate): Check >>> flag_thread_jumps. >>> (pass_early_thread_jumps::gate): Same. >>> * tree-ssa-threadedge.c (jump_threader::thread_outgoing_edges): >>> Return if !flag_thread_jumps. >>> * tree-ssa-threadupdate.c >>> (jt_path_registry::register_jump_thread): Assert that >>> flag_thread_jumps is true. >> OK. Clearly this is going to be even better once we disentangle >> threading from DOM. > Annoyingly, I had to tweak a few more tests, particularly some > -Wuninitialized -O1 ones which seem to depend on DOM jump threading to > give proper diagnostics. It seems that every change to jump threading > needs tweaks to the Wuninitialized code :-(. Well, a lot of jump threading is there to help eliminate false positives from Wuninitialized by eliminating paths through the CFG that we can prove never execute at runtime.  SO that's not a huge surprise. jeff