From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47784 invoked by alias); 20 Aug 2018 21:40:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 47770 invoked by uid 89); 20 Aug 2018 21:40:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1378, sk:types_c, V2DI_type_node, V4SI_type_node X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Aug 2018 21:40:43 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7KLZMnr100131 for ; Mon, 20 Aug 2018 17:40:41 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m01w00phb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 Aug 2018 17:40:41 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Aug 2018 17:40:39 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 20 Aug 2018 17:40:37 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7KLea5U43188238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 20 Aug 2018 21:40:36 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3232EB2066; Mon, 20 Aug 2018 17:39:44 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DCED4B205F; Mon, 20 Aug 2018 17:39:43 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 20 Aug 2018 17:39:43 -0400 (EDT) Subject: [PATCH, rs6000] Improve TREE_TYPE comparisons in fold_mergehl_helper() From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Richard Biener Cc: Segher Boessenkool , "William J. Schmidt" , David Edelsohn , GCC Patches In-Reply-To: <6AF89702-F159-432E-A24D-30FA5AE33310@gmail.com> References: <1533669898.4452.11.camel@brimstone.rchland.ibm.com> <20180807225936.GJ31204@gate.crashing.org> <1534518173.26070.13.camel@brimstone.rchland.ibm.com> <6AF89702-F159-432E-A24D-30FA5AE33310@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 20 Aug 2018 21:40:00 -0000 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit x-cbid: 18082021-0040-0000-0000-000004621A81 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009581; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01076426; UDB=6.00554895; IPR=6.00856395; MB=3.00022834; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-20 21:40:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18082021-0041-0000-0000-000008692A64 Message-Id: <1534801235.26070.16.camel@brimstone.rchland.ibm.com> X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg01195.txt.bz2 Hi, This is a follow-up to an earlier patch that enabled gimple folding of vec_mergeh and vec_mergel for the float and double data types. Per feedback from Richard, use the types_compatible_p helper to ensure we also catch any qualified types matching the V2DF_ or V4SF_ types. Regtests ran clean. OK for trunk? Thanks, -Will [gcc] 2018-08-20 Will Schmidt * config/rs6000/rs6000.c (fold_mergehl_helper): Add types_compatible_p wrappers around TREE_TYPE comparisons. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 97b922f..5f77afd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -15135,13 +15135,15 @@ fold_mergehl_helper (gimple_stmt_iterator *gsi, gimple *stmt, int use_high) tree permute_type; if (INTEGRAL_TYPE_P (TREE_TYPE (lhs_type))) permute_type = lhs_type; else { - if (TREE_TYPE (lhs_type) == TREE_TYPE (V2DF_type_node)) + if (types_compatible_p (TREE_TYPE (lhs_type), + TREE_TYPE (V2DF_type_node))) permute_type = V2DI_type_node; - else if (TREE_TYPE (lhs_type) == TREE_TYPE (V4SF_type_node)) + else if (types_compatible_p (TREE_TYPE (lhs_type), + TREE_TYPE (V4SF_type_node))) permute_type = V4SI_type_node; else gcc_unreachable (); } tree_vector_builder elts (permute_type, VECTOR_CST_NELTS (arg0), 1);