From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9956 invoked by alias); 22 Nov 2017 11:41:11 -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 9945 invoked by uid 89); 22 Nov 2017 11:41:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Nov 2017 11:41:09 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 148B3356DE; Wed, 22 Nov 2017 11:41:08 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-247.ams2.redhat.com [10.36.116.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0AAC61F40; Wed, 22 Nov 2017 11:41:07 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id vAMBf5PO020942; Wed, 22 Nov 2017 12:41:05 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vAMBeu08020941; Wed, 22 Nov 2017 12:40:56 +0100 Date: Wed, 22 Nov 2017 11:57:00 -0000 From: Jakub Jelinek To: Richard Biener , richard.sandiford@linaro.org Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Handle VEC_SERIES with both constant args in simplify_binary_operation Message-ID: <20171122114056.GS14653@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02019.txt.bz2 Hi! I've noticed that if we construct a VEC_SERIES and later propagate constants into both arguments (could happen e.g. in DEBUG_INSNs, or during combine etc.) we don't simplify that. The following patch adds that, ok for trunk if it passes bootstrap/regtest? Or should it go into simplify_constant_binary_operation instead? In there it would better match the function name, on the other side it would slow down the function for quite a marginal case, because it doesn't have a big switch on code, but instead handles just a few cases if constant operand kinds vs. the mode. 2017-11-22 Jakub Jelinek * simplify-rtx.c (simplify_binary_operation_1) : Handle the case where both arguments are using gen_const_vec_series. --- gcc/simplify-rtx.c.jj 2017-11-20 11:02:42.000000000 +0100 +++ gcc/simplify-rtx.c 2017-11-22 12:30:46.808056343 +0100 @@ -3566,6 +3566,8 @@ simplify_binary_operation_1 (enum rtx_co case VEC_SERIES: if (op1 == CONST0_RTX (GET_MODE_INNER (mode))) return gen_vec_duplicate (mode, op0); + if (CONSTANT_P (op0) && CONSTANT_P (op1)) + return gen_const_vec_series (mode, op0, op1); return 0; case VEC_SELECT: @@ -6652,6 +6654,9 @@ test_vector_ops_series (machine_mode mod ASSERT_RTX_EQ (series_r_1, simplify_binary_operation (MINUS, mode, duplicate, series_0_m1)); + ASSERT_RTX_EQ (series_0_m1, + simplify_binary_operation (VEC_SERIES, mode, const0_rtx, + constm1_rtx)); } /* Verify some simplifications involving vectors. */ Jakub