From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id A90B83858C1F for ; Wed, 7 Jun 2023 22:16:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A90B83858C1F 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-pf1-x429.google.com with SMTP id d2e1a72fcca58-64d44b198baso5693b3a.0 for ; Wed, 07 Jun 2023 15:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686176182; x=1688768182; 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=j5ympZz4b2HwMDWcvQR+0Nmw2IXDkkOXYYBtRw8v/OY=; b=PoCkjzq1K+J4JPOyxkCqsTuYYvJ0P4Eb7ptlWf5R/JX07pUcYgbXjYI/yj+6LKpIsu HUPYs8yLJXSMCR2iJC0PZf0uvyV+8S+TAlZnOrbxfMsIvfA13cCjzFeK2KxBQcTqPHaf f1nxH0tpUDm7L1avr57xgVzYfovAg2oujEToZjv79nUmizhxOxiXbF7vZi9QFkxEGerp LBFUGheKOBa8t5BmkU3215bmkMWY1cWaw1wVGLdimYAcBZJKOqat2TIJUkif1gs152AN vM5FMruMO7czmJlCFdYiFlaR/lkLf7N61HWwngMlSEFDZ0h9f8a3uY4dAiFQ06zOTPIv 5Oxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686176182; x=1688768182; 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=j5ympZz4b2HwMDWcvQR+0Nmw2IXDkkOXYYBtRw8v/OY=; b=IlGJNo7yuhZhtjlnzyQ7HyK2n+Hi2nfPxCWnN0tNG1muXZqTx03U4Bl0qFAEuSQCGk GwMTbHUc3y6pnY0EwfzsgXTNvD8X/bWh1eHasKXlSXzPRdWAC1WOPkNgOZXa9RJT/VQM UQ7mXaPvXGfpkn63t4XRrJlWbpyiqRB251n2k2kVhBZZOlenicDN4DvH2v4ur5NTl1BR Z8yxxor5EyYxdsUW4ohrkp4B2tD3wtNLahhonuqAIPeUq56QnFGab9/vM4/PC1iVhf3P 8W9FJ43/14ANmeE8j2YR46Zea9ltJczYmK4Ev1LeMtXY4nwxpP3rupHEXiJAjjfowlmP nR+Q== X-Gm-Message-State: AC+VfDxgRbSOtKFqt+WqNMb+J6cebKD2UGVa6pN6vc/92r/MtN081yOU 0rzyBX9rEan/UHeZB8/zx1Y= X-Google-Smtp-Source: ACHHUZ7zyABLwga6PMIvJRpVpBmg3LZ2EMc2eGa5rmo9jsfXVUyqTZARfwSSjwamNoKo4w265PwFRw== X-Received: by 2002:a05:6a00:2d9d:b0:647:157b:cb61 with SMTP id fb29-20020a056a002d9d00b00647157bcb61mr433471pfb.7.1686176182369; Wed, 07 Jun 2023 15:16:22 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id b17-20020aa78111000000b0064dbf805ff7sm2724855pfi.72.2023.06.07.15.16.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 15:16:21 -0700 (PDT) Message-ID: <9242b5d4-8957-b90b-7561-c97b5cf6abca@gmail.com> Date: Wed, 7 Jun 2023 16:16:20 -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 2/2] cprop_hardreg: Enable propagation of the stack pointer if possible. Content-Language: en-US To: Manolis Tsamis Cc: gcc-patches@gcc.gnu.org, Richard Biener , Palmer Dabbelt , Philipp Tomsich , Kito Cheng References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> <20230525123550.1072506-3-manolis.tsamis@vrull.eu> <46d35ebf-b73a-b60d-4e03-35327f1ce80e@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 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 5/31/23 06:15, Manolis Tsamis wrote: > On Thu, May 25, 2023 at 4:38 PM Jeff Law wrote: >> >> >> >> On 5/25/23 06:35, Manolis Tsamis wrote: >>> Propagation of the stack pointer in cprop_hardreg is currenty forbidden >>> in all cases, due to maybe_mode_change returning NULL. Relax this >>> restriction and allow propagation when no mode change is requested. >>> >>> gcc/ChangeLog: >>> >>> * regcprop.cc (maybe_mode_change): Enable stack pointer propagation. >> I can't see how this can be correct given the stack pointer equality >> tests elsewhere in the compiler, particularly the various targets. >> >> The problem is if you change the mode then you end up with multiple REG >> expressions that reference the stack pointer. >> >> See rev: d1446456c3fcaa7be628726c9de4a877729490ca and the thread around >> the change which introduced this code. >> > > Hi Jeff, > > Isn't this fine for this case since: > > 1) stack_pointer_rtx is used which won't cause issues with pointer > equalities (If I understand correctly). > 2) Propagation is guarded with `if (orig_mode == new_mode)` so only > when there is no mode change. I must have missed #2 -- is that something that changed since the first iteration for Ventana many months ago? Anyway, hoping to make meaningful progress on these two patches over the next couple days. jeff