From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 4A2453858D20 for ; Mon, 12 Jun 2023 21:36:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4A2453858D20 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-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-25bd4d3f35bso1141848a91.1 for ; Mon, 12 Jun 2023 14:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686605772; x=1689197772; 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=9IseD8b6dVtYLUMB98F9NYest2yJPOVZqysf26iMPjU=; b=lL1w+pqkKuo77H9xae/K4bZv4zC9STANWc0S1cmjlG87KTV3nA7MJngelhFrd14hw1 dx55wc3syAPyg5ez00UFQX/bnKm3079uhvVEo08sziPkytk3HAuWGFHWYqUH74OrMjML 4SIcXu1GjE/VVv1kNFCzacLYvZ+bUAu5pqfQXrKZkyBS/zvHtJDZiPW9LV2e67+IRXaB 2bYUArL9djgivzxTABQZ6LV3FkDasDymlbXwuZ08vLHfEVQLVaKGMxglfzwxT/LPrski ghMvYs8HlUemheo5H7WPmU6DlhsoPCrR3xV1A4L67QMdjzdz3O0uIdH+igDJV7ImWGjA PGNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686605772; x=1689197772; 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=9IseD8b6dVtYLUMB98F9NYest2yJPOVZqysf26iMPjU=; b=gbECJ7QGvSJHJeSKPwQFCde2LKIQMcJFd1HRXnu61mMffpur6Ubf63jurxw1JZ/hKP yMll+O9RBeCMxuV/NVtlzzGob1ZaP5RtqeSsmzBLPrssrSPLa4ZqN6ljaeu4hJhCMbOB sZ52yXdUr8njnCnal+tMVgYn0iMvMIa9mViGXLF3wZxlrWca4Zf2gZIshfVcs7SO3DUs ms6s6TNyVCWSdjLxU1dzqEMlx1QI12vL59pmuYfrkLXmRyhC0YYe7NozvgwqmyaXdPfO dwqCcAaZbJbzM0FjDUY03pId9Ow10m7qkWAFxG3Lm0voT49ujIOtuzdixWIyJtr2VdmI 36ig== X-Gm-Message-State: AC+VfDx6nmxd5XB71XNSMtH3NoEL2vd/oSDzY/3aIrWV8UHR8J4QDLVM AQ46Xer5ss/pa97x/pPnNL4= X-Google-Smtp-Source: ACHHUZ4du8i3gz2e8DRGm6S3GPF4Reqc6IclDKwPXE3Z/mgTuuoUme4eQEnKOihXERPx0AdYC/v+Ew== X-Received: by 2002:a17:90a:1589:b0:258:7448:33c2 with SMTP id m9-20020a17090a158900b00258744833c2mr8554295pja.14.1686605772140; Mon, 12 Jun 2023 14:36:12 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id m8-20020a17090a4d8800b00259a750fc89sm9539577pjh.33.2023.06.12.14.36.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 14:36:11 -0700 (PDT) Message-ID: Date: Mon, 12 Jun 2023 15:36:10 -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 1/2] Implementation of new RISCV optimizations pass: fold-mem-offsets. 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-2-manolis.tsamis@vrull.eu> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 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 6/12/23 01:41, Manolis Tsamis wrote: > > I also think that's where this should end up since most of the pass is > target independent anyway. > I just couldn't figure out what would be a proper way to model the > propagation rules for each target. > Is a target hook necessary for that? No hook should be necessary. You're already checking that the result is recognized. In theory you shouldn't have to, but checking the constraints seems advisable as well. Costing is a different matter. You might end changing an offset in such a way as to create a longer instruction on targets that have variable length encoding. If we see that we'll likely have to add some rtx cost calls and compare the before/after. But I suspect those cases are going to be limited in practice and in general if we're able to delete an earlier instruction we going to win even if the offset in the MEM changes and perhaps even results in a longer instruction. Jeff