From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 7A205393BA54; Mon, 5 Dec 2022 16:48:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A205393BA54 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-pl1-x62b.google.com with SMTP id g10so11339176plo.11; Mon, 05 Dec 2022 08:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=7PZxepvDhCkIjw4YFv5JdAxb2Ns+D4l6koY05y5VR7s=; b=ED0XcuQZLU4OF9DUWvsS/Nz50F8TWGDW2LlUa/UwTRK1bkYryoPMmBeoRir5WjmhF5 pQAyl9piefkZ7u0hy4npv87eJcwLX6lsz9WovQivFrSGC2rgJ1v0QJsqixqvTQOYa4SB UD1Y4v/9+5Zl7r4U8roJscIgZGZVFGj7/5R8hrNfPNqd0T0qqqk+LAdlfVgxGtFBJgZY da96zZKTfb1dc66J0pVHdA0KQRyoVWCk0cm5l6Vv1uQyO3+i0CdlinmmYiG9mg94+/C0 EJA86a1ozWMfHY7cUNCAxYfs4tpQCyeTW9DZ3snyNVAoYCxf5XQYTCVnVm+CvX5kxEpH 8sjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7PZxepvDhCkIjw4YFv5JdAxb2Ns+D4l6koY05y5VR7s=; b=7Uyc1aGo8ueVXVL27tnP/s2oPeohwoXYnLC2ICA/hrs8UIy2lzAabeO1IeiRv3uvby 1xQ8cECFtk8TmFn88F2vouaJUtHwAl55OFcWOhScnrtHqwSLXYVZE7s9vQpS8hAS/8ij zsvGzEGyWHTSvIoaC868kICs1FDH6tngFq2twkYECeAWPX0wcxAaQ/DMeWZc7YVQNyFD ATB8Cf2Poo+7F51luCHa5cRcsBn9grdQW0iznWCpJkM7mUNvPm0AbKefw0vQKOTZ5Uhi 517j6SJVf1lNXoY+oi0Q21+rH9lN374D4iq6Bed83IDSJX3eDulIqMgNWLl1kkSsZqGH JIhw== X-Gm-Message-State: ANoB5pmry1y4GzvsBL8cZ+u0ftJxillkarlgQAL9r18CqJ75/h250jHQ o/1tbXwIv08WHSatMAs2Qdk= X-Google-Smtp-Source: AA0mqf4rPyxv4Vvqqz6Z7u2WKVnMOsYDtIe7N7Ap060Im8XrpPAY+OWc6DRlE7zgUBropQehEFrS7Q== X-Received: by 2002:a17:90a:4fc1:b0:213:16b5:f45e with SMTP id q59-20020a17090a4fc100b0021316b5f45emr93994653pjh.170.1670258895279; Mon, 05 Dec 2022 08:48:15 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id b4-20020a17090a8c8400b00218b32f6a9esm9524027pjo.18.2022.12.05.08.48.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 08:48:14 -0800 (PST) Message-ID: Date: Mon, 5 Dec 2022 09:48:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH V2] Use subscalar mode to move struct block for parameter Content-Language: en-US To: Jiufu Guo Cc: gcc-patches@gcc.gnu.org, segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, rguenther@suse.de References: <20221117061549.178481-1-guojiufu@linux.ibm.com> <7ea64lroo6.fsf@pike.rch.stglabs.ibm.com> <9424d98e-a95f-58ae-9764-bcf8b4f503dc@gmail.com> <7efseas7f1.fsf@pike.rch.stglabs.ibm.com> <0e432b50-d500-ca2f-0db5-9e9cf099f26c@gmail.com> <7elenuzaak.fsf@pike.rch.stglabs.ibm.com> From: Jeff Law In-Reply-To: <7elenuzaak.fsf@pike.rch.stglabs.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 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 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 11/28/22 20:53, Jiufu Guo wrote: >> >> Right, but the number of registers is target dependent, so I don't see >> how using "8" or any number of that matter is correct here. > I understand. And even for the same struct type, using how many > registers to pass a parameter, it also dependends on the size of the > parameter and how many leading parameters there is. > So, as you said, "8" or any numbers are not always accurate. > > Because, the enhancement in this patch is just make "block move" to be > more friendly for follow optiomizations(cse/dse/dce...) by moving > through sub-mode. So, I just selected one arbitrary number which may > not too large and also tolerable. > I also through to query the max number registers from targets for > param/ret passing, but it may not very accurate neither. > > Any sugguestions are welcome! and thanks! OK, so it's just a magic number and (in theory) any number should still generate correct code -- the number merely places limits on when we'll consider performing this optimization. It may be overkill, but you might consider making it a PARAM that can be adjusted. > > For this patch, only simple stuffs are handled like "D.xxx = param_1", > where the source and dest of the assignment are all in memory which is > the DECL_RTL(of D.xx/param_xx) in MEM_P/BLK. > And to avoid complicate, this patch only handle the case where > "(size % mode_size) == 0". > > If any misunderstandings, please point out, thanks. > And thanks for comments! How values are justified varies on the PA depending on whether the parameter is passed in registers or in memory. Though thinking more about things, I don't think you're changing how the parameter is passed. Just how it's subsequently pulled out of memory. jeff