From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 7A0673858D32 for ; Mon, 24 Apr 2023 23:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A0673858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-52079a12451so3911412a12.3 for ; Mon, 24 Apr 2023 16:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682377516; x=1684969516; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qtpjJfanv1igUBeqXRkO+pzx/ClaaV3697bCExr7ksM=; b=VqPyutdwzwq7Y17ff9YPtKIV55DmsPfRWDmJ8rfy2uQONrCuHjcWZRswjXEyGtt6iE jYV4vc1iJFHq/FOKckT6PSG+Ca8nLmPjfEj2VM5Z1z2jMVC+pu+qtZSBEzX0qPimEyCz IulpNE6rmC45zK08r/4ZQmlM56g+BhC8qwE/kljxSEtFCZ3mtbIrZOHrB1UUuK+TeUdf T8E9t18wER9M9aJWyG/RXvKYDlHkqkJ9F1/BRpewGj9iv8rHcM0AlJemU0Ss4T9F0ikz c0trYeST5QhvhcJUwBQ1lV7/GA86rdQt9xO25/6ctZnCtad1eM7YSPX+Q3co14Dy1ccM UDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682377516; x=1684969516; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qtpjJfanv1igUBeqXRkO+pzx/ClaaV3697bCExr7ksM=; b=HSlQwmR69Z24Ifh6HwaWKMb8EeIYNPdz3uz/F6MvhwJR7yTAZ/rt0PnXowAiZ1IOj1 kE4vG6Mf4gIG0fbbp7WKLjqg3tNXQ+SyVtjCKKnxdGQd8Xu+c4SYd6ai8TdNDSGy+kU1 2wWbMjN7g6Ugfbhma9kn/ZbE3PnxJwhA58nnbbCSsyMLVd+4vON5kbEFwaAicJNhgRiy IVMgesHXSqOLKDdAzCE9k+CAsmwRr+AdKW2wBWLaMzoffu1oqXJ7hlPLIvzho54xknkV 9tTE06P2bL99OVjv8qNfdYHPYGXjuNSp96i73RLl9lGTqkJsk8au0csyWD6fA/hxsRWM LrCw== X-Gm-Message-State: AAQBX9es/ja0N8Hak9P1YBueUAGq06oR6Qj23l0Td0tR/6167aA1fjaI Dq35IaDMlfoa2fkD+ErvBdE= X-Google-Smtp-Source: AKy350aXRZlblamuxnO3IPRP6F5F/djTFh0PhzKs13LKK2p6DO5poyEbdebSZVZeFUTdj8a7Zw5c3Q== X-Received: by 2002:a17:90b:255:b0:24b:2f85:13eb with SMTP id fz21-20020a17090b025500b0024b2f8513ebmr15572794pjb.30.1682377516077; Mon, 24 Apr 2023 16:05:16 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::99f? ([2601:681:8600:13d0::99f]) by smtp.gmail.com with ESMTPSA id jd9-20020a170903260900b001a681fb3e77sm6687931plb.44.2023.04.24.16.05.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Apr 2023 16:05:15 -0700 (PDT) Message-ID: <8bd8b246-a252-0e05-414c-ab1e35975aea@gmail.com> Date: Mon, 24 Apr 2023 17:05:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v1] [RFC] Improve folding for comparisons with zero in tree-ssa-forwprop. Content-Language: en-US To: Richard Biener , Philipp Tomsich Cc: Manolis Tsamis , Andrew MacLeod , gcc-patches@gcc.gnu.org References: <20230316152706.2214124-1-manolis.tsamis@vrull.eu> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 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,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 List-Id: On 4/24/23 02:06, Richard Biener via Gcc-patches wrote: > On Fri, Apr 21, 2023 at 11:01 PM Philipp Tomsich > wrote: >> >> Any guidance on the next steps for this patch? > > I think we want to perform this transform later, in particular when > the test is a loop exit test we do not want to do it as it prevents > coalescing of the IV on the backedge at out-of-SSA time. > > That means doing the transform in folding and/or before inlining > (the test could become a loop exit test) would be a no-go. In fact > for SSA coalescing we'd want the reverse transform in some cases, see > PRs 86270 and 70359. > > If we can reliably undo for the loop case I suppose we can do the > canonicalization to compare against zero. In any case please split > up the patch (note I've also > hoped we could eventually get rid of that part of > tree-ssa-forwprop.cc in favor > of match.pd patterns since it uses GENERIC folding :/). > Do we have enough information to do this at expansion time? That would avoid introducing the target dependencies to drive this in gimple. Jeff