From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109047 invoked by alias); 27 Sep 2018 14:11:56 -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 109032 invoked by uid 89); 27 Sep 2018 14:11:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 14:11:55 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1g5X1F-0005aJ-51 from Andrew_Stubbs@mentor.com ; Thu, 27 Sep 2018 07:11:53 -0700 Received: from [172.30.88.37] (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 27 Sep 2018 15:11:48 +0100 Subject: Re: [PATCH 11/25] Simplify vec_merge according to the mask. To: , References: <333c6a5ad2f1c56613c4734a830fc5d8214061d9.1536144068.git.ams@codesourcery.com> <87pnxc4hp0.fsf@arm.com> <047d2b64-5a08-599c-9529-3e1270c38791@codesourcery.com> <875zys433p.fsf@arm.com> <2b7abb07-b9df-71a1-056c-2985067e74d3@codesourcery.com> <87wor72ywo.fsf@arm.com> From: Andrew Stubbs Message-ID: <91e1512c-c88c-92a5-47b1-d51fe8f63a99@codesourcery.com> Date: Thu, 27 Sep 2018 14:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87wor72ywo.fsf@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg01666.txt.bz2 On 27/09/18 08:16, Richard Sandiford wrote: > On keeping the complexity down: > > if (side_effects_p (x)) > return NULL_RTX; > > makes this quadratic for chains of unary operations. Is it really > needed? The code after it simply recurses on operands and doesn't > discard anything itself, so it looks like the VEC_MERGE call to > side_effects_p would be enough. The two calls do not check the same thing. The other one checks the other operand of a vec_merge, and this checks the current operand. I suppose it's safe to discard a VEC_MERGE when the chosen operand contains side effects, but I'm not so sure when the VEC_MERGE itself is an operand to an operator with side effects. I'm having a hard time inventing a scenario in which a PRE_INC could contain a VEC_MERGE, but maybe a volatile MEM or ASM_OPERANDS could do? Conversely, I don't see that side-effects deep down in an expression should stop us transforming it as a high level. Is there an equivalent to side_effects_p that doesn't recurse? Should there be? Andrew