From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id A2EAA385841A for ; Thu, 29 Jun 2023 09:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2EAA385841A 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 D36EB2185A for ; Thu, 29 Jun 2023 09:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688032574; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=ZC+2+ixcbDV7Kt477DBuDJB0IunCVJ1vksvHkzN/CEQ=; b=KiP6JPue9DV7QtZ5XuevJ8rpkL0EZ/X6oVgKuYFdPgueYWDx5zZzlh5bZ6N9JTHiy7T727 AigRpsYeFaJvH/5zZkUPKXQmg6W93KjXTZrxTD/s0xtF7km2GU1GpJT+gkpgyfRFgMpeid 7zq/D3rpMnSPzP0fCxybkjUX8pwJLhE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688032574; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=ZC+2+ixcbDV7Kt477DBuDJB0IunCVJ1vksvHkzN/CEQ=; b=geLe8YTnIm4co3CGWE6hmqHG75DBdrTYTM2BpFizK53lYaIgZypz3TPn3OqGh8cx9E6wUQ /O4EgbUFPdjZ2rAg== 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 C97342C141 for ; Thu, 29 Jun 2023 09:56:14 +0000 (UTC) Date: Thu, 29 Jun 2023 09:56:14 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/110460 - fend off vector types from vectorizer 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=-10.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,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: Message-ID: <20230629095614.4op7C7etcWUdxP5cxO_qqjauxOLyKXefzPB0P4VWKHQ@z> The following makes fending off existing vector types from vectorization also apply to word_mode vector types. I've chosen to add a positive list of allowed scalar types here for clarity. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/110460 * tree-vect-stmts.cc (get_related_vectype_for_scalar_type): Only allow integral, pointer and scalar float type scalar_type. --- 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 d642d3c257f..68faa8ead39 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -12174,8 +12174,11 @@ get_related_vectype_for_scalar_type (machine_mode prevailing_mode, machine_mode simd_mode; tree vectype; - if (!is_int_mode (TYPE_MODE (scalar_type), &inner_mode) - && !is_float_mode (TYPE_MODE (scalar_type), &inner_mode)) + if ((!INTEGRAL_TYPE_P (scalar_type) + && !POINTER_TYPE_P (scalar_type) + && !SCALAR_FLOAT_TYPE_P (scalar_type)) + || (!is_int_mode (TYPE_MODE (scalar_type), &inner_mode) + && !is_float_mode (TYPE_MODE (scalar_type), &inner_mode))) return NULL_TREE; unsigned int nbytes = GET_MODE_SIZE (inner_mode); -- 2.35.3