From patchwork Fri Nov 3 06:41:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 161170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp839130vqu; Thu, 2 Nov 2023 23:41:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/GEip+guk0+GeQVlTy4WOeQ/f+kq03nVA3kk3MYd4s7Tfv4z7gbL7MCAZbK42bCpz+JA3 X-Received: by 2002:a0c:b3cc:0:b0:66d:3690:7c2f with SMTP id b12-20020a0cb3cc000000b0066d36907c2fmr17851992qvf.51.1698993718483; Thu, 02 Nov 2023 23:41:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698993718; cv=pass; d=google.com; s=arc-20160816; b=QHXWi+5TyVsqU0mPoewS2ajcnDYeiqXULHaMiVH5jSy0AnJ5QrHm8mMoL7fVnmOuAH jnjONJ6AetdPcoM/jpH55IaTxuhJltuNDW/AdMR2fr51ZRUMIC233WgMnvKGSWeX1MeW h/+kR8KO/kAF9QfW9AoAUuTltsY1C/aCBa34Iot1KfYedxKW1NZxiKetoG0qJR1eHU0x /D4Drmkg7e0+Xdzl6/dkgzC4TslWpSrXFQx4fkyGevULgcdL4iMB9aSpfIfHPj9ugbhm jR1rR9iJXYDzp3C/AN5GA1K/aOsPDQJsnuYLpnZpHDPxsRJ7RpGAdU1u+7GQ4B0qZVwQ 3ipw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-filter:dmarc-filter:delivered-to; bh=umOqNibNeWmT47cWrZ+Ezgi0LpxCJMQtr0kE97lzgl8=; fh=Hxj0cw/2jAkyitv6gv3v4BQlApRvZwleU4172JThTNQ=; b=UJ0vgb/iva8AokhRE7uaxzdm3ioDjr2e8iXCpsPyBUddaWaehIWLu8/KkygsQ+ZQ1b xrqBxq4xKQ8KgSb8rdtI4JMwOevdJYG85HI3CNbvuRBhJvp7W101ySTcrBscY91aEFJU J06NjHb90+l9gYWaxDOYWG60IZgW5YTZYCXhA1XiMdFPk4rKa1dQHqwuYTlayN/5w3sQ wxU2i9Mv2Jbt/sGs1SWREYuKM2/Oe4QM/O4GNOTNGMl9gFEZwwqlDb2/HhPUoyRfsG0U DlmrIF1v9/dNx3bqhjeSDrT0z5trCW37MHGNp3ykCvQje2q8JMh7EBBxBF1m+D5jFBx6 LZyA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f14-20020a0cf7ce000000b0066cffff776dsi989139qvo.172.2023.11.02.23.41.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 23:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44BC73857C41 for ; Fri, 3 Nov 2023 06:41:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by sourceware.org (Postfix) with ESMTPS id 10C7E3858C50 for ; Fri, 3 Nov 2023 06:41:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 10C7E3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 10C7E3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.207.22.56 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698993695; cv=none; b=OEH9jAfZ1NAJxCKkZvcbe63t8HZquQB7wQXVq6RaEGYJuaynCvg+sZwIHUHk1SH3ftbv2pppz74hkV8/p5hjnyOghjalZ6lSQiEcl89oZh1ZGoanTporzPqVss8G53boScrW//7W2ISXxH6XEgmVAmvZvxYVLeDGqlwDxfON7zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698993695; c=relaxed/simple; bh=xx4zOrtbImiBLuDpNZa+bJIX3CxIjNBbZLmV0k0TZew=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=wezLVfFpiRDwA3QLE4OwXXAzlPgsQ4rxQrIQoswKXQBuNDrTB0QPcp/KY0grhkt9nqto9VT2Q8O+62HQVyHSos5Kz7f8hgJcq0rzg7W3GThw8/e/A/jDGXETixjJqElb+OgiC9y4EnVujWACaQFj9qAIT+8FMf1sjIdgSZIet4Y= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp62t1698993677tvw6i7r7 Received: from rios-cad122.hadoop.rioslab.org ( [58.60.1.26]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 03 Nov 2023 14:41:15 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: GjIRyctCEYCj1z7fI8vnDcPqIjgGfPCJy0ZC2VgdNK/x+qnQcdGLsEDRe3Ov+ O3YvvqlA9QrJNTEY1WSK6vfSXRnvKwLd9oJqrRLT4Mo5pXTwrO3SyZIX65jd82KnwUpllUH quAzLNurkbDcIi4TfsGuyqKg1BexXDw8RUpbcP9VS1aA9cmDdUvrDDfpXI6fwPohVGn2FhJ EIa8mDLOC0CWIfdWgcwJ6gFeqhRsRxeljFDmIiQUNg6ySCEbAUAsh/n3mzaG4o4wB336QCx eobzFi0R4k5c3bHhk8I/IfNVydsxwojTElM+qVnIBf2G1+7rs92rH0Vnx3p4wqoDjArhEjj Byi7BjwCHkWPzlFKdInrWi/FlSLRITAn7sOIAT5EqtClnQf7+G6RVQ1YYsbS/SnMauUZ7lQ Vh41oBGTfGC6GntY1iYZmw== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 8195571525295081812 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com, rguenther@suse.de, Juzhe-Zhong Subject: [tree-optimization/111721 V2] VECT: Support SLP for MASK_LEN_GATHER_LOAD with dummy mask Date: Fri, 3 Nov 2023 14:41:13 +0800 Message-Id: <20231103064113.823617-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781524037487542334 X-GMAIL-MSGID: 1781524037487542334 This patch fixes following FAILs for RVV: FAIL: gcc.dg/vect/vect-gather-1.c -flto -ffat-lto-objects scan-tree-dump vect "Loop contains only SLP stmts" FAIL: gcc.dg/vect/vect-gather-1.c scan-tree-dump vect "Loop contains only SLP stmts" Bootstrap on X86 and regtest passed. Ok for trunk ? PR tree-optimization/111721 gcc/ChangeLog: * tree-vect-slp.cc (vect_get_and_check_slp_defs): Support SLP for dummy mask -1. * tree-vect-stmts.cc (vectorizable_load): Ditto. --- gcc/tree-vect-slp.cc | 5 ++--- gcc/tree-vect-stmts.cc | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 43d742e3c92..6b8a7b628b6 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -759,9 +759,8 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap, if ((dt == vect_constant_def || dt == vect_external_def) && !GET_MODE_SIZE (vinfo->vector_mode).is_constant () - && (TREE_CODE (type) == BOOLEAN_TYPE - || !can_duplicate_and_interleave_p (vinfo, stmts.length (), - type))) + && TREE_CODE (type) != BOOLEAN_TYPE + && !can_duplicate_and_interleave_p (vinfo, stmts.length (), type)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 6ce4868d3e1..8c92bd5d931 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -9825,6 +9825,7 @@ vectorizable_load (vec_info *vinfo, tree mask = NULL_TREE, mask_vectype = NULL_TREE; int mask_index = -1; + slp_tree slp_op = NULL; if (gassign *assign = dyn_cast (stmt_info->stmt)) { scalar_dest = gimple_assign_lhs (assign); @@ -9861,7 +9862,7 @@ vectorizable_load (vec_info *vinfo, mask_index = vect_slp_child_index_for_operand (call, mask_index); if (mask_index >= 0 && !vect_check_scalar_mask (vinfo, stmt_info, slp_node, mask_index, - &mask, NULL, &mask_dt, &mask_vectype)) + &mask, &slp_op, &mask_dt, &mask_vectype)) return false; } @@ -10046,7 +10047,7 @@ vectorizable_load (vec_info *vinfo, { if (slp_node && mask - && !vect_maybe_update_slp_op_vectype (SLP_TREE_CHILDREN (slp_node)[0], + && !vect_maybe_update_slp_op_vectype (slp_op, mask_vectype)) { if (dump_enabled_p ())