From patchwork Wed Jul 17 11:55:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 169117 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp870873ilk; Wed, 17 Jul 2019 04:56:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeTxqQiMyPATx3kY9s7NguV8goKdNFLix4cGJXMWhbqF9ZsKgTC7AQO4z5lvuAGeA3JeuT X-Received: by 2002:a17:902:1102:: with SMTP id d2mr42599975pla.149.1563364588747; Wed, 17 Jul 2019 04:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563364588; cv=none; d=google.com; s=arc-20160816; b=JZ4lh0eTvjFJKTqImoEcqdUcqC2lHigZckDs13MGOOQDg6XHKWIZe2LmYhxklTq4Nf iv6a8ImEwQ6UcnwO2PLjtEGUPMWIB9GmF074Xhw01mZbKoudngqLHqTFh5uiVzWrvJS3 nDsPtQqfEbY5lt68AHFXM9Y34ebxlchb2jcmEnYNVrEPGvXfLQ5F39P6KLAq3gehM1b/ 4gOGB5FlnBX8yMcKxGFM3r8fu+hmpFVD/NxWzmDF8IljboNxM8uPQAqw2fdbJyRIygKE 507If/MgRHkvY3MctLQCNAqgypsAUexYqC9vXEXgitq9F1Wa2/AWM2+cMIwNzqRsXJWH g4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=wTQxSm8sL+s58AIVWKJwW21ZUkUHWfzAgjuhO/gKSmY=; b=TWMhKl9jTpCglQn1Tyj5NjaPPa/c23/s3I0SHmf6sDzSQOScMam7jwfdDARKHCgqv2 RCVV5UzlD6W6ZeByoA7+7HKWYqnOIfftCQmB1SqzmxvPIRvvY9KZe/cVDPaBUYGLrmPY W5nkNh0ChhB2Rf1BrND4t39HHBGzPLyOa66oxyGtzwfxDRTS72xQiRsGHZBkLbB9KBgw DKO2lj17P6aAWpg5RFKTVt7Soj7qpIJTOr5aGWOG0DDIbWPe2TFc0HsFoAj1odn/eAhb HZnHR0hSoQxQDng+BDtI6u29m76nPdy1F77VzQzsRuK1hFUkP8SVJxyBB3h8C4ra1zCf 1viQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=unnUEq8i; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iMks+/J0"; spf=pass (google.com: domain of gcc-patches-return-505203-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-505203-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s8si23374071pjb.40.2019.07.17.04.56.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jul 2019 04:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-505203-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=unnUEq8i; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iMks+/J0"; spf=pass (google.com: domain of gcc-patches-return-505203-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-505203-patch=linaro.org@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=l3nhJJSW01Uike+L4jGvjvz5OF/FgtpGtF2HAfWbWiY/fb qkRiGW8zJFbOW7nzrsX5BydnWp/yFvmADTZZ2ApCMochkvF2W1bHpaxl5gQxyGKU CNlXjvafaM88v/AB1/saA6kvvWwLGHHnH5KsiureM8fncCgB88GiE3ZCwpA6E= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=DWPfMDeGKIU6NJ+1KD6aIiij8i4=; b=unnUEq8iPPMAsr57x55N TTwknBXWEOx2vl1F1uWFKwBPZ0PQHDRpt9DyL1DbHHifUJ5m4hpEipnITRopk55u X81SgHGK4hrGqbFntDmUOR9MLZLOPZ5WiwNwQ8NVgLdMxt8v/5LfwrdWDg+Nmk+0 d1KQ11LeoymGhq2t34f6jZQ= Received: (qmail 122702 invoked by alias); 17 Jul 2019 11:56:17 -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 122684 invoked by uid 89); 17 Jul 2019 11:56:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f175.google.com Received: from mail-lj1-f175.google.com (HELO mail-lj1-f175.google.com) (209.85.208.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jul 2019 11:56:15 +0000 Received: by mail-lj1-f175.google.com with SMTP id m23so23288105lje.12 for ; Wed, 17 Jul 2019 04:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=0iYQPPY0DNTS6KveUJ4sZtoSb9bHSkTFfunkzRmN9Ak=; b=iMks+/J0VDCsd7Hy9WV7fUP/c/0Z+DbZjCZW/zUG46upADdCD1tYVn3NtqCjB5JrRF y/ujI7Kbw7T07xdi+qMf7REcG2680doOD+DiOGTEj8oNmT74VvYD6xUBf18IBZ25FpWA xgum0c00fJ+3A9WrKhUA5sMqva/HaooYKNEq7L+AM2apoYGzjcknkwtCBEgbIlmrTuxW RpTNOJ2hWlNj6LtkJ4I0W6i37gvwfoXL9MW1ylxCbt90oJlSEaGYWVcfleuf3UbQH/fP tXGiPZHS41W0BNq+AatSBSeXGpb77WPgPxkJtO/S7nMBggzpQR0SDPkh3NJ9P8c9YZ6R pDdw== MIME-Version: 1.0 From: Prathamesh Kulkarni Date: Wed, 17 Jul 2019 17:25:36 +0530 Message-ID: Subject: PR91166 - Unfolded ZIPs of constants To: Richard Sandiford , Richard Biener , gcc Patches X-IsSubscribed: yes Hi, The attached patch tries to fix PR91166. Does it look OK ? Bootstrap+test in progress on aarch64-linux-gnu and x86_64-unknown-linux-gnu. Thanks, Prathamesh 2019-07-17 Prathamesh Kulkarni PR middle-end/91166 * match.pd (vec_perm_expr(v, v, mask) -> v): New pattern. (define_predicates): Add entry for uniform_vector_p. testsuite/ * gcc.target/aarch64/sve/pr91166.c: New test. diff --git a/gcc/match.pd b/gcc/match.pd index 4a7aa0185d8..2ad98c28fd8 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -36,7 +36,8 @@ along with GCC; see the file COPYING3. If not see integer_valued_real_p integer_pow2p uniform_integer_cst_p - HONOR_NANS) + HONOR_NANS + uniform_vector_p) /* Operator lists. */ (define_operator_list tcc_comparison @@ -5568,3 +5569,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) { bitsize_int (at * tree_to_uhwi (TYPE_SIZE (TREE_TYPE (type)))); }) (if (changed) (vec_perm { op0; } { op1; } { op2; })))))))))) + +/* VEC_PERM_EXPR (v, v, mask) -> v where v contains same element. */ +(simplify + (vec_perm (vec_duplicate@0 @1) @0 @2) + { @0; }) + +(simplify + (vec_perm uniform_vector_p@0 @0 @1) + { @0; }) diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr91166.c b/gcc/testsuite/gcc.target/aarch64/sve/pr91166.c new file mode 100644 index 00000000000..42654be3b31 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/pr91166.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=armv8.2-a+sve -fdump-tree-optimized" } */ + +void +f1 (double x[][4]) +{ + for (int i = 0; i < 4; ++i) + for (int j = 0; j < 4; ++j) + x[i][j] = 0; +} + +void +f2 (double x[][4], double y) +{ + for (int i = 0; i < 4; ++i) + for (int j = 0; j < 4; ++j) + x[i][j] = y; +} + +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized"} } */