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: =?utf-8?b?6ZKf5bGF5ZOy?= X-Patchwork-Id: 1858804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMB3y35Hsz1yQq for ; Fri, 3 Nov 2023 17:41:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6257D3858023 for ; Fri, 3 Nov 2023 06:41:46 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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 ())