From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 438763858016 for ; Wed, 31 Jan 2024 14:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 438763858016 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 438763858016 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706710138; cv=none; b=OsSUfLrRqVPERA6N/oIdUIdSQHwwvIlLT45oqe9wMfcZTv7H60Lh7NfvTKE+u66QYEk+W5tw7+CefLRTk0Woc09lENM2ZhwOynnNlJ3clqsWmBFciF4mlodMEd5LShgIPBzZ5biKPvb3GVuuhfxz2bsFw/m5y+sDMkvMPl3Ac8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706710138; c=relaxed/simple; bh=coZ2H5QSnXYLE+gVOFsw4tZtIL7nb++7Ac9EkyaDIZ0=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=GOk5V5dQB8m2XtGzoqCMNBHiWO5wVcoceYTabmgVU8nqzI+OFMZPKO0a9DjjqoB99yt/1nc7NFyRXvnZMQIPsh1KJhBXNioTGmgcXDyG/pmlKePjL3W/hTt1ZqWqZXZLo4x/4a2kbUWKor3c9XJ2xy4dFRQa2s4Y39n2WignlQI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.4.150] (unknown [10.168.4.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4186722029; Wed, 31 Jan 2024 14:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706710131; 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=LvPjNdSBAwok1YtD94OC6i9moyJWSb4uEMOFe11ce0g=; b=2HH2069qjF+VQi/07JNJx3JRCG7PdjbNnWkCdskHaeOqfGVhSjxVpWamV+f8B1XcoYZPbQ 8JOSKCuMZnlam81u1/pCDXL68/YfuK3WBC8rZLFSCtFTQDUxW6KOOq5kIW1nki/EhKNfKi de2+WABbSjRUvD6poYL5jHwz37e+QMY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706710131; 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=LvPjNdSBAwok1YtD94OC6i9moyJWSb4uEMOFe11ce0g=; b=plDKR9DkkaQnPjCO9i/kiir/8fbg6jobJPVcLZVKHle8+nepqZY9l+ZMMopAnfgzu9XIua ppeb4MFM491HfnAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706710131; 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=LvPjNdSBAwok1YtD94OC6i9moyJWSb4uEMOFe11ce0g=; b=2HH2069qjF+VQi/07JNJx3JRCG7PdjbNnWkCdskHaeOqfGVhSjxVpWamV+f8B1XcoYZPbQ 8JOSKCuMZnlam81u1/pCDXL68/YfuK3WBC8rZLFSCtFTQDUxW6KOOq5kIW1nki/EhKNfKi de2+WABbSjRUvD6poYL5jHwz37e+QMY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706710131; 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=LvPjNdSBAwok1YtD94OC6i9moyJWSb4uEMOFe11ce0g=; b=plDKR9DkkaQnPjCO9i/kiir/8fbg6jobJPVcLZVKHle8+nepqZY9l+ZMMopAnfgzu9XIua ppeb4MFM491HfnAg== Date: Wed, 31 Jan 2024 15:03:13 +0100 (CET) From: Richard Biener To: "Andre Vieira (lists)" cc: gcc-patches@gcc.gnu.org, Richard.Sandiford@arm.com Subject: Re: [PATCH 1/3] vect: Pass stmt_vec_info to TARGET_SIMD_CLONE_USABLE In-Reply-To: <545r8s73-675p-4o48-sr66-q6956nqp6r6p@fhfr.qr> Message-ID: <02q2n46q-nr12-q90o-rq2o-10p489q57s46@fhfr.qr> References: <20240130143132.9575-1-andre.simoesdiasvieira@arm.com> <20240130143132.9575-2-andre.simoesdiasvieira@arm.com> <47e1aeb2-94ac-4733-b49f-ea97932cc49f@arm.com> <545r8s73-675p-4o48-sr66-q6956nqp6r6p@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-3.10 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: X-Spam-Score: -3.10 X-Spam-Status: No, score=-5.2 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 Wed, 31 Jan 2024, Richard Biener wrote: > On Wed, 31 Jan 2024, Andre Vieira (lists) wrote: > > > > > > > On 31/01/2024 12:13, Richard Biener wrote: > > > On Wed, 31 Jan 2024, Richard Biener wrote: > > > > > >> On Tue, 30 Jan 2024, Andre Vieira wrote: > > >> > > >>> > > >>> This patch adds stmt_vec_info to TARGET_SIMD_CLONE_USABLE to make sure the > > >>> target can reject a simd_clone based on the vector mode it is using. > > >>> This is needed because for VLS SVE vectorization the vectorizer accepts > > >>> Advanced SIMD simd clones when vectorizing using SVE types because the > > >>> simdlens > > >>> might match. This will cause type errors later on. > > >>> > > >>> Other targets do not currently need to use this argument. > > >> > > >> Can you instead pass down the mode? > > > > > > Thinking about that again the cgraph_simd_clone info in the clone > > > should have sufficient information to disambiguate. If it doesn't > > > then we should amend it. > > > > > > Richard. > > > > Hi Richard, > > > > Thanks for the review, I don't think cgraph_simd_clone_info is the right place > > to pass down this information, since this is information about the caller > > rather than the simdclone itself. What we are trying to achieve here is making > > the vectorizer being able to accept or reject simdclones based on the ISA we > > are vectorizing for. To distinguish between SVE and Advanced SIMD ISAs we use > > modes, I am also not sure that's ideal but it is what we currently use. So to > > answer your earlier question, yes I can also pass down mode if that's > > preferable. > > Note cgraph_simd_clone_info has simdlen and we seem to check elsewhere > whether that's POLY or constant. I wonder how aarch64_sve_mode_p > comes into play here which in the end classifies VLS SVE modes as > non-SVE? Maybe it's just a bit non-obvious as you key on mangling: static int -aarch64_simd_clone_usable (struct cgraph_node *node) +aarch64_simd_clone_usable (struct cgraph_node *node, stmt_vec_info stmt_vinfo) { switch (node->simdclone->vecsize_mangle) { case 'n': if (!TARGET_SIMD) return -1; + if (STMT_VINFO_VECTYPE (stmt_vinfo) + && aarch64_sve_mode_p (TYPE_MODE (STMT_VINFO_VECTYPE (stmt_vinfo)))) + return -1; ? What does 'n' mean? It's documented as /* The mangling character for a given vector size. This is used to determine the ISA mangling bit as specified in the Intel Vector ABI. */ unsigned char vecsize_mangle; which is slightly misleading.