From patchwork Thu Dec 2 12:31:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 48389 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF2B93858030 for ; Thu, 2 Dec 2021 12:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF2B93858030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638448348; bh=mv3FjmkI2y4M7gZGwkad/ACVNmLoonrRHgxFjB+8XT8=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Fsgseyl7cUOHEeIvBvBZvzZA+f55gAXJlr+M4oMef3anYx+YfWy+Gf9FgJhxqVkUr PtJfhe5+X+EZBZIwwxkDM2aEWAb4MEdc+fNyYJPZLOKO3YFHhu7is8D2wuDJj2+HBG 0XpCdbkCqlqFu0WRDePlwWyBpdPLnjEvyiIj+0e8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 529E73858D28 for ; Thu, 2 Dec 2021 12:31:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 529E73858D28 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-out1.suse.de (Postfix) with ESMTPS id 13CDC212B9 for ; Thu, 2 Dec 2021 12:31:58 +0000 (UTC) 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 EB56B13E65 for ; Thu, 2 Dec 2021 12:31:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jb3QN728qGE5IwAAMHmgww (envelope-from ) for ; Thu, 02 Dec 2021 12:31:57 +0000 Date: Thu, 2 Dec 2021 13:31:57 +0100 (CET) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/103527 - always use thruth type forgather mask Message-ID: <6o5r5295-rnss-4325-p8pp-q7974o22q4o@fhfr.qr> MIME-Version: 1.0 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This makes sure to always use a truth type to build the gather mask argument even when the target builtin prototype in the end wants a float vector. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-12-02 Richard Biener PR tree-optimization/103527 * tree-vect-stmts.c (vect_build_gather_load_calls): Always use a truth type for building the vector mask. --- gcc/tree-vect-stmts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 9726450ab2d..e63bc2afdaa 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -2740,7 +2740,7 @@ vect_build_gather_load_calls (vec_info *vinfo, stmt_vec_info stmt_info, && (!mask || TREE_CODE (masktype) == INTEGER_TYPE || types_compatible_p (srctype, masktype))); - if (mask && TREE_CODE (masktype) == INTEGER_TYPE) + if (mask) masktype = truth_type_for (srctype); tree mask_halftype = masktype; @@ -2893,7 +2893,8 @@ vect_build_gather_load_calls (vec_info *vinfo, stmt_vec_info stmt_info, if (masktype != real_masktype) { tree utype, optype = TREE_TYPE (mask_op); - if (TYPE_MODE (real_masktype) == TYPE_MODE (optype)) + if (VECTOR_TYPE_P (real_masktype) + || TYPE_MODE (real_masktype) == TYPE_MODE (optype)) utype = real_masktype; else utype = lang_hooks.types.type_for_mode (TYPE_MODE (optype), 1);