From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11038 invoked by alias); 2 Nov 2015 22:46:52 -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 11023 invoked by uid 89); 2 Nov 2015 22:46:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 02 Nov 2015 22:46:50 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 40983C0A148A; Mon, 2 Nov 2015 22:46:49 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-134.phx2.redhat.com [10.3.113.134]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA2Mkm9J025726; Mon, 2 Nov 2015 17:46:49 -0500 Subject: Re: [PATCH][RTL-ifcvt] PR rtl-optimization/67749: Do not emit separate SET insn in IF-ELSE case To: Kyrill Tkachov , GCC Patches References: <562F8EFB.9080000@arm.com> From: Jeff Law Message-ID: <5637E7D8.1010509@redhat.com> Date: Mon, 02 Nov 2015 22:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562F8EFB.9080000@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00138.txt.bz2 On 10/27/2015 08:49 AM, Kyrill Tkachov wrote: > Hi all, > > This patch fixes the gcc.dg/ifcvt-2.c test for x86_64 where we were > failing to if-convert. This was because in my patch at > https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=228194 which > tried to emit a SET to move the source of insn_a or insn_b (that came > from the test block) into a temporary. A SET however, is not always > enough. For example, on x86_64 in order for the resulting insn to be > recognised it frequently needs to be in PARALLEL with a (clobber > (reg:CC FLAGS_REG)). This leads to the insn not being recognised. I don't think it affects the approach you've chosen, but I'm mentioning it for future reference. gcse.c has some helper code (that probably ought to move into a more generic file) that will test for this situation. Search for the instances of recog. It essentially does something like emit_insn (gen_rtx_SET (...)) And tries to recognize the result to determine if it's valid. > > So this patch removes that SET and instead generates a couple of > temporary pseudos that gets passed on a bit later to the code that > loads the operands into registers when they're not general_operand. > This way we just modify the existing (recognisable) sets, allowing us > to if-convert the testcase. That sounds much more reasonable, assuming that the original destinations were just used once and those uses are guaranteed to be going away. > > Bootstrapped and tested on x86_64, arm, aarch64. > > Ok for trunk? What happens in the case were noce_emit_bb returns a failure? We've modified the original insns to use the new pseudos. Won't this result in the original pseudo's uses using undefined values? jeff