From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id E970C3858D28 for ; Tue, 1 Aug 2023 23:38:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E970C3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a36b309524so4896729b6e.3 for ; Tue, 01 Aug 2023 16:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690933096; x=1691537896; 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=cDS/pF9HHLSNNg4jinxzLIIhSKTVa9XUzGXUEH7EkdQ=; b=b6EPlrsVqgb+OMuXdb0/fHzIBmJu62+tiHiS7u64hCLxXH2v1vH8rAXNGSvAudGrEy h81VKQThQYVJL7xeT+DgMW0at8RVPKTQfeTnjZAB/k3DnyKUrttLUr7cUzV+2RLqudQq 0sqnRgPa+5jmQLqNx7B5g4lxyexzL1EKw46LG3QxP7yE3vcQ1TVuQ3bG3FG3EJ3EwyFN ZrWxBJHQ6egmuHCG3rrEm+DmED0meqPUQ5xu0YHxgnYk2Ff5uRcgFCnZl84j6U886ZPA neki+wxLcLHHiNhb81vx1D+XkVMB9Fvw8sBzLC2CzbIu1johnVM52jNDmxaNks1TGooF 0OUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690933096; x=1691537896; 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=cDS/pF9HHLSNNg4jinxzLIIhSKTVa9XUzGXUEH7EkdQ=; b=euy05quUia7pn9YtezRAvKb5/rYdzC8+tjrxOBB1FcDZNKZSb77Nx9dXVReVy8WveJ BP9R0fkJYSjLuNAHR0fnKQvKexaYDhmvacdKHnirnFcWan22TUETOPTyR1KmEhsRWM4g fo17gcIT4F2KP24qBsdeZDhhbuJdMLGGmyMZ6jvhjMX+wMvQ1fKpgsNtbRtpcf+92ocA MRU9NXbrEl3BNeKMlEiMUGz/ROe6Exgatd2AZUy6OfoseD0tKtoyag4sLMlMEasZ4kka iy5+ZSi8zMvgcTvIo2dGZr1na3iU3ImunFVbpmY0CfAe6RLTcww4yDkbiRyLAUROeCdI 4vkg== X-Gm-Message-State: ABy/qLY8ltmjbHpOJETugqrpeEPA+HK1BxIiQUL2ggCDbxWbye1NVSmm nA0z0CfH8wDbiSe9hx8HAw4zUg== X-Google-Smtp-Source: APBJJlFB1Mg5XfhU2710ouw+PREAkbkfiyLGOqnVmZ1MN/jNWziyG0LUji/6kII/sQe9acju5AYsqg== X-Received: by 2002:a05:6808:3086:b0:3a7:4a89:752c with SMTP id bl6-20020a056808308600b003a74a89752cmr4230360oib.31.1690933096234; Tue, 01 Aug 2023 16:38:16 -0700 (PDT) Received: from [10.0.16.165] ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id n10-20020aa7904a000000b0068285a7f107sm10033116pfo.177.2023.08.01.16.38.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 16:38:15 -0700 (PDT) Message-ID: Date: Tue, 1 Aug 2023 16:38:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: RISC-V: Folding memory for FP + constant case Content-Language: en-US To: Jeff Law , Philipp Tomsich Cc: Manolis Tsamis , Jivan Hakobyan , gcc-patches@gcc.gnu.org References: <3c1f0f8a-34ed-abb2-8a49-3083a2cc55d2@gmail.com> <61c9b9c2-f52e-2b4e-6d02-62c991603c39@gmail.com> <64233838-fe5e-458d-1eaf-3025b5448d85@rivosinc.com> <91c12503-c288-5b81-8941-cc62bab2ee98@gmail.com> <73dc8b97-7a7b-d9a0-2e8e-b4a5aaa3ee93@rivosinc.com> <40176a5c-382d-809d-a4b1-06c6541c3670@gmail.com> From: Vineet Gupta In-Reply-To: <40176a5c-382d-809d-a4b1-06c6541c3670@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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 8/1/23 16:27, Jeff Law wrote: > > > On 8/1/23 17:13, Vineet Gupta wrote: >> >> On 8/1/23 16:06, Philipp Tomsich wrote: >>> Very helpful! Looks as if regprop for stack_pointer is now either too >>> conservative — or one of our patches is missing in everyone's test >>> setup; we'll take a closer look. >> >> FWIW, all 5 of them involve a SH2ADD have SP as source in the fold FP >> case which f-m-o seems to be generating a MV for. > To clarify f-m-o isn't generating the mv.  It's simplifying a sequence > by pushing the constant in an addi instruction into the memory > reference.  As a result the addi simplifies into a sp->reg copy that > is supposed to then be propagated away. Yep, that's clear. > > Also note that getting FP out of the shift-add sequences is the other > key goal of Jivan's work.  FP elimination always results in a > spill/reload if we have a shift-add insn where one operand is FP. Hmm, are you saying it should NOT be generating shift-add with SP as src, because currently thats exactly what fold FP offset *is* doing and is the reason it has 5 less insns. -Vineet