From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id DC4C33857B8E for ; Mon, 24 Jul 2023 12:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC4C33857B8E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 91952206F4; Mon, 24 Jul 2023 12:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690201876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cwf8MhbH/MwsSOwi8BjlcObQ1Ft63dG6EbAKc/UYkfw=; b=QfyzP1NAVZ+jSIVdC237MAmZph/VgghOpm7ps6a7XAI5ePJj7qBV3O6AVbdX3tyzbW+xzh XX8XXPrMAaYtxsOu4cS0bNKZ7/fKHyWOkDS8e51JRu2gkOPR4fkwwZtkF+kDGnzJAdVEcQ 8HKAbJnysij5V9qSGxTzDO4dvPWBG88= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690201876; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cwf8MhbH/MwsSOwi8BjlcObQ1Ft63dG6EbAKc/UYkfw=; b=lNT+xhGrlEdCxEQPPc+YpTO+IyLjZkI19TjoyAg6XOfOAm93X7xHtF0tpTo0ea6dtV94fW raGNu4Nzb7HXFCDw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 814A12C142; Mon, 24 Jul 2023 12:31:16 +0000 (UTC) Date: Mon, 24 Jul 2023 12:31:16 +0000 (UTC) From: Richard Biener To: Richard Sandiford cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Remove SLP_TREE_VEC_STMTS in favor of SLP_TREE_VEC_DEFS In-Reply-To: Message-ID: References: <20230724102431.94955138E8@imap2.suse-dmz.suse.de> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Mon, 24 Jul 2023, Richard Sandiford wrote: > Richard Biener writes: > > The following unifies SLP_TREE_VEC_STMTS into SLP_TREE_VEC_DEFS > > which can handle all cases we need. > > > > Bootstrap & regtest running on x86_64-unknown-linux-gnu. > > Nice! Just curious... > > > @@ -149,6 +147,20 @@ _slp_tree::~_slp_tree () > > free (failed); > > } > > > > +/* Push the single SSA definition in DEF to the vector of vector defs. */ > > + > > +void > > +_slp_tree::push_vec_def (gimple *def) > > +{ > > + if (gphi *phi = dyn_cast (def)) > > + vec_defs.quick_push (gimple_phi_result (phi)); > > + else > > + { > > + def_operand_p defop = single_ssa_def_operand (def, SSA_OP_ALL_DEFS); > > + vec_defs.quick_push (get_def_from_ptr (defop)); > > + } > > +} > > ...what does this handle that gimple_get_lhs wouldn't? asms? I was worried about stores where this would pick up the virtual definition. But double-checking reveals we don't push vector defs in vectorizable_store for SLP. I haven't made up my mind whether we should (for consistency). It also makes sure we don't end up with calls with a LHS and a virtual definition - that's what we eventually are going to trip over here. In principle when there's no 'LHS' we can use any SSA def. That said, I'm not sure either, just wanted to make a few cases more to work in odd code we might have here or there ... Btw, the above function is eventually going to be legacy though currently it's the most used. Richard.