From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1222A3858401 for ; Fri, 18 Aug 2023 11:41:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1222A3858401 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-out1.suse.de (Postfix) with ESMTP id F09CB21875; Fri, 18 Aug 2023 11:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692358882; 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=9TTj5PR3ZskE8RNNwfGAsKXCAK2dDKb4VWW+VlHBH68=; b=Hwex+IwyOv4nAjkIg2EshgqMoG+8dFl8yAfRwcet/N2QENPbL9kgJ1E1kvE8YtfIP6Vyw/ 2EohSqs8GgF525NhZQ93jhs1ze9oKtt7uw2pebN8Sj4ikpCMyT22otsHWnm376Jcv5eD9t Y/gPUchA862CcWDjtsq3VvkN1zjMpTs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692358882; 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=9TTj5PR3ZskE8RNNwfGAsKXCAK2dDKb4VWW+VlHBH68=; b=stmHutp3wsWf0KpMfMNbFup6V42TLHlT93kItc+iyCqhUwoiwvBoHzmpX9LYlBkGLngEDK jEQ+C+MLSwjy5sCA== 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 CF56B2C142; Fri, 18 Aug 2023 11:41:22 +0000 (UTC) Date: Fri, 18 Aug 2023 11:41:22 +0000 (UTC) From: Richard Biener To: Prathamesh Kulkarni cc: Jeff Law , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization In-Reply-To: Message-ID: References: <20230728070552.50C1413276@imap2.suse-dmz.suse.de> <320f94c3-8805-ec64-dd4b-0454c8ecce14@gmail.com> 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 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 Fri, 18 Aug 2023, Richard Biener wrote: > On Thu, 17 Aug 2023, Prathamesh Kulkarni wrote: > > > On Tue, 15 Aug 2023 at 14:28, Richard Sandiford > > wrote: > > > > > > Richard Biener writes: > > > > On Mon, 14 Aug 2023, Prathamesh Kulkarni wrote: > > > >> On Mon, 7 Aug 2023 at 13:19, Richard Biener wrote: > > > >> > It doesn't seem to make a difference for x86. That said, the "fix" is > > > >> > probably sticking the correct target on the dump-check, it seems > > > >> > that vect_fold_extract_last is no longer correct here. > > > >> Um sorry, I did go thru various checks in target-supports.exp, but not > > > >> sure which one will be appropriate for this case, > > > >> and am stuck here :/ Could you please suggest how to proceed ? > > > > > > > > Maybe Richard S. knows the magic thing to test, he originally > > > > implemented the direct conversion support. I suggest to implement > > > > such dg-checks if they are not present (I can't find them), > > > > possibly quite specific to the modes involved (like we have > > > > other checks with _qi_to_hi suffixes, for float modes maybe > > > > just _float). > > > > > > Yeah, can't remember specific selectors for that feature. TBH I think > > > most (all?) of the tests were AArch64-specific. > > Hi, > > As Richi mentioned above, the test now vectorizes on AArch64 because > > it has support for direct conversion > > between vectors while x86 doesn't. IIUC this is because > > supportable_convert_operation returns true > > for V4HI -> V4SI on Aarch64 since it can use extend_v4hiv4si2 for > > doing the conversion ? > > > > In the attached patch, I added a new target check vect_extend which > > (currently) returns 1 only for aarch64*-*-*, > > which makes the test PASS on both the targets, altho I am not sure if > > this is entirely correct. > > Does the patch look OK ? > > Can you make vect_extend more specific, say vect_extend_hi_si or > what is specifically needed here? Note I'll have to investigate > why x86 cannot vectorize here since in fact it does have > the extend operation ... it might be also worth splitting the > sign/zero extend case, so - vect_sign_extend_hi_si or > vect_extend_short_int? And now having anaylzed _why_ x86 doesn't vectorize it's rather why we get this vectorized with NEON which is because static opt_machine_mode aarch64_vectorize_related_mode (machine_mode vector_mode, scalar_mode element_mode, poly_uint64 nunits) { ... /* Prefer to use 1 128-bit vector instead of 2 64-bit vectors. */ if (TARGET_SIMD && (vec_flags & VEC_ADVSIMD) && known_eq (nunits, 0U) && known_eq (GET_MODE_BITSIZE (vector_mode), 64U) && maybe_ge (GET_MODE_BITSIZE (element_mode) * GET_MODE_NUNITS (vector_mode), 128U)) { machine_mode res = aarch64_simd_container_mode (element_mode, 128); if (VECTOR_MODE_P (res)) return res; which makes us get a V4SImode vector for a V4HImode loop vector_mode. So I think the appropriate effective dejagnu target is aarch64-*-* (there's none specifically to advsimd, not sure if one can disable that?) Richard. > > Thanks, > > Prathamesh > > > > > > Thanks, > > > Richard > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)