From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id A14EC388A004 for ; Thu, 2 Apr 2020 10:08:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A14EC388A004 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 032A3alK140558 for ; Thu, 2 Apr 2020 06:08:03 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 304edxu8g6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 02 Apr 2020 06:08:03 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Apr 2020 11:07:49 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 2 Apr 2020 11:07:47 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 032A7w9449807430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Apr 2020 10:07:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5C6142047; Thu, 2 Apr 2020 10:07:58 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5618142045; Thu, 2 Apr 2020 10:07:57 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.197.245.104]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 2 Apr 2020 10:07:57 +0000 (GMT) Subject: Re: [PATCH] Fix PR94401 by considering reverse overrun To: Jakub Jelinek Cc: GCC Patches , Bill Schmidt , Segher Boessenkool References: <20200402082834.GO2212@tucnak> From: "Kewen.Lin" Date: Thu, 2 Apr 2020 18:07:55 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200402082834.GO2212@tucnak> Content-Type: text/plain; charset=gbk Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20040210-0008-0000-0000-00000368FE9E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20040210-0009-0000-0000-00004A8A89F2 Message-Id: <5e92fc81-bd24-d866-26ee-48a251e69b82@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-02_01:2020-03-31, 2020-04-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 adultscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020087 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, MIME_CHARSET_FARAWAY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Thu, 02 Apr 2020 10:08:04 -0000 Hi, on 2020/4/2 ÏÂÎç4:28, Jakub Jelinek wrote: > Hi! > > On Thu, Apr 02, 2020 at 03:15:42PM +0800, Kewen.Lin via Gcc-patches wrote: > > Just formatting nits, not commenting on what the actual patch does. > >> --- a/gcc/tree-vect-stmts.c >> +++ b/gcc/tree-vect-stmts.c >> @@ -9590,11 +9590,20 @@ vectorizable_load (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, >> if (new_vtype != NULL_TREE) >> ltype = half_vtype; >> } >> + tree offset = dataref_offset >> + ? dataref_offset >> + : build_int_cst (ref_type, 0); > > The above is misformatted. The ? and : shouldn't be indented further than > the dataref_offset, but usually e.g. for the sake of emacs we add ()s around > the expression in this case. So: > tree offset = (dataref_offset > ? dataref_offset > : build_int_cst (ref_type, 0)); > or > tree offset > = (dataref_offset > ? dataref_offset : build_int_cst (ref_type, 0)); > Thanks Jakub! I'll follow this by add () for ternary expression. With manual added "()", clang-format can get below: tree offset = (dataref_offset ? dataref_offset : build_int_cst (ref_type, 0)); contrib/check_GNU_style.sh didn't complain this, I'm not sure whether it's possible to add this kind of convention into contrib/clang-format. >> + if (ltype != vectype >> + && memory_access_type == VMAT_CONTIGUOUS_REVERSE) >> + offset = size_binop ( >> + PLUS_EXPR, >> + build_int_cst (ref_type, >> + DR_GROUP_GAP (first_stmt_info) >> + * tree_to_uhwi ( >> + TYPE_SIZE_UNIT (elem_type))), >> + offset); > > Again, no reason to indent * by 2 columns from DR_GROUP_GAP. But also all > the (s at the end of line and randomly indented arguments look ugly. > I'd recommend temporaries, e.g. like (perhaps with different names of > temporaries, so that they don't shadow anything): > > { > unsigned HOST_WIDE_INT gap > = DR_GROUP_GAP (first_stmt_info); > gap *= tree_to_uhwi (TYPE_SIZE_UNIT (elem_type)); > tree gapcst = build_int_cst (ref_type, gap); > offset = size_binop (PLUS_EXPR, offset, gapcst); > } > Good suggestion, will update it. BR, Kewen