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 52EB23858D37 for ; Thu, 25 May 2023 14:03:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 52EB23858D37 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-x532.google.com with SMTP id 41be03b00d2f7-530638a60e1so1458427a12.2 for ; Thu, 25 May 2023 07:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1685023413; x=1687615413; 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=wlNwjv3mi9J5Uvtsvt437ABtffSouDkQQRs/8LYRk8k=; b=MvbC/IC/fPAr9aexjspVAJs+hWbvSiMN0cQURzMkTRyNkL+QAk25bT2GblL61FWfst QYd3j4Te1saA/16s9Hw0t2FUc2MsgSm3V5JYx1p4/ZLYRZmlpOKnegy+HOo/Z1T0hTJE EJ0cD/WpYtNCbPUzIVy3/ijIBXeSWSUmlUwAcxg9ZwIcPcX4+Suw8mIotrOA3H6C0EMo 8pETP6HedxUGVBbfgmVlsBLdbMl1U0dNfJW9vdF5nIdjHzscuhzCEo18WVaafUciKtTG hGHxZxfeC61sD9DphK1owdMBKwsv7kTJt56wX9XXyabfkIVyATnAA7f1GnQzseO3/Ff2 9Dmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685023413; x=1687615413; 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=wlNwjv3mi9J5Uvtsvt437ABtffSouDkQQRs/8LYRk8k=; b=TAqdsCaCdioYItv4Sb47jsMwdQu67eqmijplop+MbIJOehBCkaTa92udo3QYM9gYU1 zAywMKaYeHIR8iTfN/h/aYwyO6atV9vxmD6Xe+evkJcUcPJ5HFT1Yg8ROXoEGvluByks jDOCyUolO32n9YxvnLFoQ7FPU9FaVWlxmOUK6wxyndCrEruiYcZ6MqXss0a8UqWq9/ij xYqEw8Y7DTgcXBYKXUlEc1X8/KGA3xvAinTTdW+es5N0AOAib54ekOY1XoxxVFXeoqk1 VUtCerMMOFSeqssqGQ42WgqX8nPktstgiu3qZg5g1wEXgNdNPbmai4xcN4/4Q+lNcPRj AoxQ== X-Gm-Message-State: AC+VfDzv54prxscJDkxgmQ/r6XVt06moqA33+fzRqH3ZVdfTt5rNFqFf JwqJZ+PA2oUBAdwUaKYDRJli8zbrchh30NmS5yPIPg== X-Google-Smtp-Source: ACHHUZ6qAgGw2dwbN3U7RCcaIf0FlMISX4/mNwsrR9Ybf1eAwzH3BUbHEjU8Hdk3w8zRBEJnQIv6DamOfknobRQonXU= X-Received: by 2002:a17:90a:590d:b0:24d:df69:5c67 with SMTP id k13-20020a17090a590d00b0024ddf695c67mr2171281pji.12.1685023413194; Thu, 25 May 2023 07:03:33 -0700 (PDT) MIME-Version: 1.0 References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> <20230525123550.1072506-2-manolis.tsamis@vrull.eu> In-Reply-To: From: Manolis Tsamis Date: Thu, 25 May 2023 17:02:57 +0300 Message-ID: Subject: Re: [PATCH 1/2] Implementation of new RISCV optimizations pass: fold-mem-offsets. To: Richard Biener Cc: Jeff Law , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.7 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:53=E2=80=AFPM Richard Biener via Gcc-patches wrote: > > On Thu, May 25, 2023 at 3:32=E2=80=AFPM Jeff Law via Gcc-patches > wrote: > > > > > > > > On 5/25/23 07:01, Richard Biener via Gcc-patches wrote: > > > On Thu, May 25, 2023 at 2:36=E2=80=AFPM Manolis Tsamis wrote: > > >> > > >> Implementation of the new RISC-V optimization pass for memory offset > > >> calculations, documentation and testcases. > > > > > > Why do fwprop or combine not what you want to do? > > I think a lot of them end up coming from register elimination. > > Why isn't this a problem for other targets then? Or maybe it is and this > shouldn't be a machine specific pass? Maybe postreload-gcse should > perform strength reduction (I can't think of any other post reload pass > that would do something even remotely related). > > Richard. > It should be a problem for other targets as well (especially RISC-style ISA= s). It can be easily seen by comparing the generated code for the testcases: Example for testcase-2 on AArch64: https://godbolt.org/z/GMT1K7Ebr Although the patterns in the test cases are the ones that are simple as the complex ones manifest in complex programs, the case still holds. The code for this pass is quite generic and could work for most/all targets if that would be interesting. Manolis > > jeff