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 8E9933858C62 for ; Mon, 28 Nov 2022 18:40:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8E9933858C62 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 imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5609E1FDC1 for ; Mon, 28 Nov 2022 18:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669660857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=5/6YnSeIkObmoWqEmPzJh65E7P/wcuH9GkAc0FUuvx4=; b=dwtaGCFG+XnAbG2m34M9rZkCMGzEvJQli7EZXDPI1OQs/rzXfqQrCX7PTzxXWaeHd0/aw1 BDlBFaRCMohxW/jGxV03NnhL7dV2BdVI8B34ihJe6brVWUyoCMOHhlm9ledyNM14mqlU0X hydj8PILHQuVSKGecRfrPiHUq1O7JJk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669660857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=5/6YnSeIkObmoWqEmPzJh65E7P/wcuH9GkAc0FUuvx4=; b=kpAotrZQaEtq5eg56olXZgu7nfHRBtKzgGp/r5Glw3UWnoYdR43cKGmWVe0xflBj7d2WH/ Z84hlFf+nPLhzDDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3FF501326E for ; Mon, 28 Nov 2022 18:40:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /bK6DbkAhWPnKQAAMHmgww (envelope-from ) for ; Mon, 28 Nov 2022 18:40:57 +0000 Date: Mon, 28 Nov 2022 19:40:56 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/107896 - allow v2si to dimode unpacks MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20221128184057.3FF501326E@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: The following avoids ICEing for V2SI -> DImode vec_unpacks_lo. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/107896 * tree-vect-stmts.cc (supportable_widening_operation): Handle non-vector mode intermediate mode. --- gcc/tree-vect-stmts.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index b35b986889d..5485da58b38 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -12194,9 +12194,8 @@ supportable_widening_operation (vec_info *vinfo, if (VECTOR_BOOLEAN_TYPE_P (prev_type)) intermediate_type = vect_halve_mask_nunits (prev_type, intermediate_mode); - else + else if (VECTOR_MODE_P (intermediate_mode)) { - gcc_assert (VECTOR_MODE_P (intermediate_mode)); tree intermediate_element_type = lang_hooks.types.type_for_mode (GET_MODE_INNER (intermediate_mode), TYPE_UNSIGNED (prev_type)); @@ -12204,6 +12203,10 @@ supportable_widening_operation (vec_info *vinfo, = build_vector_type_for_mode (intermediate_element_type, intermediate_mode); } + else + intermediate_type + = lang_hooks.types.type_for_mode (intermediate_mode, + TYPE_UNSIGNED (prev_type)); if (VECTOR_BOOLEAN_TYPE_P (intermediate_type) && VECTOR_BOOLEAN_TYPE_P (prev_type) -- 2.35.3