From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 9F78E3858D1E for ; Sat, 11 Mar 2023 16:14:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F78E3858D1E 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-x635.google.com with SMTP id i3so8673291plg.6 for ; Sat, 11 Mar 2023 08:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678551296; 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=DFiWoKvlxZGESFc3fST4YJ/aTKazNrMNaKyMEMBy4+Y=; b=Z6g4v5ylSGPN8FwDlKnIGOOYRz9LR54gZJgt1o8OftaNxb5fpLj23c2mtg+tyRbUqj mMG9fezwfHkADhTVKF7Dc4aATVIdI+DVSmvZKdWxQxnhC9qyBXNRcAZQD4lCeoJpKGjM Db4nbywzEA57OijYy+FYYXoNo4aWBUeRmlBJFyMxyHHiirkYp8NM5QmbhO8lnrMZiMnq 2r9UWSkRYgZEapQe+f1S1t59S7pERV1HLPYZGn7NoQ24A1K7Yr1Y/JkwRk9Fij4VdEJw M9nfvI3rTFPZ3F3dGCaeBXT5llfp3omQ5JiVHn5/LVWgXmtwT9dcHQTwHvjMiRX5ZPkG rmog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678551296; 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=DFiWoKvlxZGESFc3fST4YJ/aTKazNrMNaKyMEMBy4+Y=; b=aMbpdC9SNn//VPC9RlkeXuHkZyagZZThSiX6o4C4aqZnVDgAcMYZBx8r5ZkF8B7Wcg N6jj33CGGgJEtNC/MNxHHBZeAqb1aQY6WxnMY3cc4+XtEPqsSLl98I/T94cEc6AWCZdN t9APEMRscIiOHUlEk3EVaEATbrFCLFsiP14WN3tjHRVxWkbRDat4GQ0u6ySc2FWmMCNo bBX19RxBrdb7zoukXckZtTNj7LNSeFUQRmSDw+YzjCaUkjGSgt8NFAUSYOxaC5blDvmZ qbE0qFBPI9mif9FoqBccnmVImzeAUOfpmkUsMT6WaZ5WxJh1elSLmcU/lw9qghNJGUb9 mDRA== X-Gm-Message-State: AO0yUKV3kZDcDtruzkIFuAIdAV4qBH0C56gM4sqaOK4zxpo396ZNYWsU R9KGCYDURtAyxb2lHdCwGIw= X-Google-Smtp-Source: AK7set/GJPY9ChhCkqpca6p7SL4p4rJr7O3NAOCflt/kmfpRaZ9tAl5VkveOG1D3Lf/7VApJU3o54A== X-Received: by 2002:a17:902:d50f:b0:19e:aafe:f7e9 with SMTP id b15-20020a170902d50f00b0019eaafef7e9mr30908807plg.25.1678551296433; Sat, 11 Mar 2023 08:14:56 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id u8-20020a170902b28800b0019ce95b1319sm1705578plr.264.2023.03.11.08.14.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Mar 2023 08:14:55 -0800 (PST) Message-ID: <3d77d0e0-540e-0bfe-dcb9-67d502303c52@gmail.com> Date: Sat, 11 Mar 2023 09:14:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] tree-optimization/109046 - re-combine complex loads Content-Language: en-US To: Richard Biener , gcc-patches@gcc.gnu.org Cc: Jakub Jelinek References: <20230307110836.D4AD8385B514@sourceware.org> From: Jeff Law In-Reply-To: <20230307110836.D4AD8385B514@sourceware.org> 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 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 3/7/23 04:08, Richard Biener via Gcc-patches wrote: > The following addresses PR109046 by adding an optimization to forwprop > to combine a piecewise complex load to a complex load when there are > no uses of the components. That's something useful in general and > easier to do than avoiding the splitting in complex lowering. Presumably instead of "no uses of the components" you meant to say "no other uses of the components". > > The testcase exercises both the manual and the complex lowering case. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > Thanks, > Richard. > > PR tree-optimization/109046 > * tree-ssa-forwprop.cc (pass_forwprop::execute): Combine > piecewise complex loads. > > * gcc.dg/tree-ssa/forwprop-39.c: New testcase. > --- [ ... ] > + /* Rewrite a component-wise load of a complex to a complex > + load if the components are not used separately. */ > + else if (TREE_CODE (rhs) == SSA_NAME > + && has_single_use (rhs) Did you really meant to test that RHS is single use? Isn't that the COMPLEX_EXPR here? It would seem fine to me to allow multiple uses of the COMPLEX_EXPR itself. Am I missing something? The only conceptual concern I have would be volatile objects. But in that case were're replacing a piecewise load of the volatile with a single complex load. That probably better matches what the developer expected anyway. So OK as-is if you really wanted the COMPLEX_EXPR to have a single use. Or OK after removing that test. Jeff