From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id D79A83858414 for ; Thu, 25 May 2023 13:42:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D79A83858414 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-x430.google.com with SMTP id d2e1a72fcca58-64d4e45971bso1644931b3a.2 for ; Thu, 25 May 2023 06:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685022136; x=1687614136; 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=ki+k2P0OqXyvwfrjUL2h41ADPheLenm2/06Xk+zYu8k=; b=WiJlqDCVqE1yHC6MwlB0htlNM2aZ64mMIKWcjZ+skrcr5A9NPUFA+qItsOkhF66JTo CMWScY99wSFzbsPb5wERQIAUAS0S54p5i86kAx0BX7T7+pd4FTYvyxa/HwsO4/1GP+Rk lYdmSP4ZFuIuC2NrNx1vBhhU3YWwSUszip7zawjYj4o+vNVFkLxDX7jVlPF2dIcxy6Dz lG5Gx4QzNbW64GEwhACT0quz96Wllyb1wWEKqQK8OWJ7Qo3njL0V/ux55dnCEpc9y/YB zQdE/ve9GqxQfxu9fyEsCwp3mafLhlkfnZcyiqYC8TXSsayFHwTcA17DSsy+zHBkX1Wz 3AyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685022136; x=1687614136; 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=ki+k2P0OqXyvwfrjUL2h41ADPheLenm2/06Xk+zYu8k=; b=juxiWqx4YPNMLwCnwCv1bJxjV9PISbv0xwNBeGrg/1UUp8uPh4botPqKOBqst5uuh7 ylWlfGlVAJOCNFhxtjvM8wh2r5Oy98qe+rIk+cduVCN8d2RPiWuT35GptdCh8uJnptyV 7cZRIhX6zFYvFNTNv24cxk9lDjkqA8rQc0LUThfA/DiEZPFeTiZOuwyS+DOq6OmEZgQD hQWaPQserQn761YGeOtLKBMsZ19rNHu0hzEEHZ4QOeO1pAyLRqpzoelozAkkvrzE+OKm Mn1vye0FYL6UuDUejSk9FxgpxWgT4ChlszzZ4xC6molLGm4fzK7VdBtfGO571bPkEWvV VvGQ== X-Gm-Message-State: AC+VfDw6XMiC4i582Q4G6uuC88BJoOcQlyauHg8otqchByw5k8YbWXR4 tBxeBooA2DBebCGZSRnzTsA= X-Google-Smtp-Source: ACHHUZ6ZaUdMZkhEPCbtDDv4Jvezy0ocfkvqORgGqdbd/r/0kv03JfKasBiQnfLNfh1ikA1IOQVebw== X-Received: by 2002:a05:6a20:258a:b0:10f:6293:8b0e with SMTP id k10-20020a056a20258a00b0010f62938b0emr373582pzd.37.1685022135808; Thu, 25 May 2023 06:42:15 -0700 (PDT) Received: from ?IPV6:2601:681:8d00:265::f0a? ([2601:681:8d00:265::f0a]) by smtp.gmail.com with ESMTPSA id x52-20020a056a000bf400b0064d681c753csm1223267pfu.40.2023.05.25.06.42.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 06:42:15 -0700 (PDT) Message-ID: Date: Thu, 25 May 2023 07:42:13 -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 0/2] RISC-V: New pass to optimize calculation of offsets for memory operations. Content-Language: en-US To: Manolis Tsamis , gcc-patches@gcc.gnu.org Cc: Richard Biener , Palmer Dabbelt , Philipp Tomsich , Kito Cheng References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> From: Jeff Law In-Reply-To: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/25/23 06:35, Manolis Tsamis wrote: > > This pass tries to optimize memory offset calculations by moving them > from add immediate instructions to the memory loads/stores. > For example it can transform this: > > addi t4,sp,16 > add t2,a6,t4 > shl t3,t2,1 > ld a2,0(t3) > addi a2,1 > sd a2,8(t2) > > into the following (one instruction less): > > add t2,a6,sp > shl t3,t2,1 > ld a2,32(t3) > addi a2,1 > sd a2,24(t2) > > Although there are places where this is done already, this pass is more > powerful and can handle the more difficult cases that are currently not > optimized. Also, it runs late enough and can optimize away unnecessary > stack pointer calculations. > > The first patch in the series contains the implementation of this pass > while the second is a minor change that enables cprop_hardreg's > propgation of the stack pointer, because this pass depends on cprop > to do the propagation of optimized operations. If preferred I can split > this into two different patches (in which cases some of the testcases > included will fail temporarily). Thanks Manolis. Do you happen to know if this includes the fixes I passed along to Philipp a few months back? My recollection is one fixed stale DF data which prevented an ICE during bootstrapping, the other needed to ignore debug insns in one or two places so that the behavior didn't change based on the existence of debug insns. Jeff