From patchwork Mon Aug 20 21:40:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 959993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-484022-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mTrAT/6I"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vS0j1DsTz9s5c for ; Tue, 21 Aug 2018 07:40:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=tuSAfEmOHE+Emk0lp2mgbCQK2xUN9AA6LBucdg4gpTi/RTLKpv Z3xAxooWV2vTwcjIuUMKRsK3tpQDbNFD2talFItkdOOb1lOHsze7R//npX1LhJGw K8P1+DW/n/1KC8cLT+BQPKPn5o8EktgGbX6XEuTcVfs/7sRWE+xzRuXkg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=H14T/1DytXGuWGk3VEzcQn3Ac9k=; b=mTrAT/6I5qoux8ETjGXE o+jXRGMgbsFt3MzK+a+HW41hWrr5yYBXnLuhac/Lrs0CczkN9t6PVzkT6GW0Mps5 j6/ix+GvBmLlMTBEhRNR1Wn3O6H0PUeeFJ15afDvOZvauH9Guf6AKWhG2jeJq0pl DZJqf5lgbogSLzaWHzNk5OA= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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> Date: Mon, 20 Aug 2018 16:40:35 -0500 Mime-Version: 1.0 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 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);