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 04C9B3858D32 for ; Thu, 25 May 2023 13:57:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04C9B3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-53469299319so1152563a12.3 for ; Thu, 25 May 2023 06:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1685023066; x=1687615066; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U5t3qDx4nkyMbblBL29HNDAzD+nPgw4P318klXWx35k=; b=ml7jz9hRP2DYpiTTBVMLTUJGk70ogcma+iykJ1XtriAZYYYYQKWMyw8A9nwsYz1NCh zC16DiTmTIOKdwy58BLVpNG9S7CKZNUnEFDT7OdfeCZivnJKBI4hsBXPVJEtVh5CbNz+ LkoNOpmvx+6GQ7zWm7VSEd1v4+xV6ub2s/92cc1erjIzlTMstrR9JITnQiYZgS7h/bkx PinWm11hOOcTfm9GC4DBeMMovHtBCQsCnaQWh7/T/RsOlDJOaFccHaJet7KgMs+JYM1r zuC6zhAAaY0fans4z3+p4iroHg3o8vbSL/mfYx72qa3EC6c8DQwMSRmMaK6N/9Cn0jjX tLBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685023066; x=1687615066; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U5t3qDx4nkyMbblBL29HNDAzD+nPgw4P318klXWx35k=; b=SLwJCU5JSpWhzGspW8jBGW7xV6ZCRSga69grKKBZ/9JGnYayWs8hm6vBrIAcaFOuZh gSMzP06zoR/8nUoGlnHEjQERUCGR6us/Db9KbIWhJvUBeLAxgNURjb00dJvHSNflI1TY xjlB0bTEF392leYROkb0Zry/tkSz0ii69X8gkdHLmhWiezj+wrLag8EeLc6zdKTAEqWa uyl6QLLZgKvlNTQnGmouOlOiJwuh2bPj6AfvU4Gav9MI/vsaTnLL7JLqOUi/brKph+H0 cUb4BLoq0LoA64bb5FDR+w8coVpb7oDeH6C7Q3Qy+XS+DEiWANcNkvBOisp7B0C6Li// 5CUQ== X-Gm-Message-State: AC+VfDxmx+j53Wf+j+VyyiLgM57oqhfeQfwH6Fq1hnGDmNg1B0MTj06c Qaut33l/j5F4CQ50YF5gxtnPT9ZBgdJMI/GkaST9lw== X-Google-Smtp-Source: ACHHUZ5F6z1CTEBsBVReUonuUOhHRrq/cd2rMrtAe3FKxbBmbR5pFe0IieVQLxmPYtNi8TjkHEFOzW84yfX+a5cAcLk= X-Received: by 2002:a17:902:da8b:b0:1af:cabb:87b6 with SMTP id j11-20020a170902da8b00b001afcabb87b6mr2318575plx.19.1685023065901; Thu, 25 May 2023 06:57:45 -0700 (PDT) MIME-Version: 1.0 References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> In-Reply-To: From: Manolis Tsamis Date: Thu, 25 May 2023 16:57:10 +0300 Message-ID: Subject: Re: [PATCH 0/2] RISC-V: New pass to optimize calculation of offsets for memory operations. To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Richard Biener , Palmer Dabbelt , Philipp Tomsich , Kito Cheng Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, May 25, 2023 at 4:42=E2=80=AFPM Jeff Law wr= ote: > > > > 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. > Hi Jeff, Yes this does include your fixes for DF and debug insns, along with some other minor improvements. Also, thanks for catching these! Manolis > > Jeff