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 9B7FB385DC01 for ; Fri, 21 Jul 2023 06:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B7FB385DC01 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-out2.suse.de (Postfix) with ESMTP id 2BBAF206ED; Fri, 21 Jul 2023 06:20:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689920440; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fl0uR1exRlWDDCT/5iF2NyNAMR854zBhVczQL6oYH38=; b=rpfjHoe5Kc5Ndr1tsYa+2OY2TTP31a9wiZkI0PU7PD5jJJj3Tj3b9YpAkm0lxTOvVpq3iY tREDB56Yqm2dbxJDOtpEcYM1n3yYbyRBh9bjA0MplLTW/TK2EFPq5//Am8AW1zD6lsk5e/ 1ohv9LCzAThUUo+CvJDzJTS2Q+szTjc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689920440; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Fl0uR1exRlWDDCT/5iF2NyNAMR854zBhVczQL6oYH38=; b=htwSTpAw8AUGHKE5u1ZrWRJ6cRA20WRlsUqgJZxDh8Z+LngGJPLKlgDKnmzJAqcgcbMQOs xXU/7aOr1fUsO0BQ== 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 1CD7B2C142; Fri, 21 Jul 2023 06:20:40 +0000 (UTC) Date: Fri, 21 Jul 2023 06:20:40 +0000 (UTC) From: Richard Biener To: Juzhe-Zhong cc: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: [PATCH] cleanup: Change condition order In-Reply-To: <20230721022343.314043-1-juzhe.zhong@rivai.ai> Message-ID: References: <20230721022343.314043-1-juzhe.zhong@rivai.ai> 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=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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: On Fri, 21 Jul 2023, Juzhe-Zhong wrote: > Hi, Richard and Richi. > > I have double check the recent codes for len && mask support again. > > Some places code structure: > > if (len_mask_fn) > ... > else if (mask_fn) > ... > > some places code structure: > > if (mask_len_fn) > ... > else if (mask) > > Base on previous review comment from Richi: > https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625067.html > > len mask stuff should be checked before mask. > > So I reorder all condition order to check LEN MASK stuff before MASK. > > This is the last clean up patch. > > Boostrap and Regression is on the way. OK. > gcc/ChangeLog: > > * tree-vect-stmts.cc (check_load_store_for_partial_vectors): Change condition order. > (vectorizable_operation): Ditto. > > --- > gcc/tree-vect-stmts.cc | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc > index d5b4f020332..2fe856db9ab 100644 > --- a/gcc/tree-vect-stmts.cc > +++ b/gcc/tree-vect-stmts.cc > @@ -1635,17 +1635,17 @@ check_load_store_for_partial_vectors (loop_vec_info loop_vinfo, tree vectype, > internal_fn len_ifn = (is_load > ? IFN_MASK_LEN_GATHER_LOAD > : IFN_MASK_LEN_SCATTER_STORE); > - if (internal_gather_scatter_fn_supported_p (ifn, vectype, > + if (internal_gather_scatter_fn_supported_p (len_ifn, vectype, > gs_info->memory_type, > gs_info->offset_vectype, > gs_info->scale)) > - vect_record_loop_mask (loop_vinfo, masks, nvectors, vectype, > - scalar_mask); > - else if (internal_gather_scatter_fn_supported_p (len_ifn, vectype, > + vect_record_loop_len (loop_vinfo, lens, nvectors, vectype, 1); > + else if (internal_gather_scatter_fn_supported_p (ifn, vectype, > gs_info->memory_type, > gs_info->offset_vectype, > gs_info->scale)) > - vect_record_loop_len (loop_vinfo, lens, nvectors, vectype, 1); > + vect_record_loop_mask (loop_vinfo, masks, nvectors, vectype, > + scalar_mask); > else > { > if (dump_enabled_p ()) > @@ -6596,16 +6596,16 @@ vectorizable_operation (vec_info *vinfo, > && LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo) > && mask_out_inactive) > { > - if (cond_fn != IFN_LAST > - && direct_internal_fn_supported_p (cond_fn, vectype, > + if (cond_len_fn != IFN_LAST > + && direct_internal_fn_supported_p (cond_len_fn, vectype, > OPTIMIZE_FOR_SPEED)) > - vect_record_loop_mask (loop_vinfo, masks, ncopies * vec_num, > - vectype, NULL); > - else if (cond_len_fn != IFN_LAST > - && direct_internal_fn_supported_p (cond_len_fn, vectype, > - OPTIMIZE_FOR_SPEED)) > vect_record_loop_len (loop_vinfo, lens, ncopies * vec_num, vectype, > 1); > + else if (cond_fn != IFN_LAST > + && direct_internal_fn_supported_p (cond_fn, vectype, > + OPTIMIZE_FOR_SPEED)) > + vect_record_loop_mask (loop_vinfo, masks, ncopies * vec_num, > + vectype, NULL); > else > { > if (dump_enabled_p ()) > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)