From patchwork Wed Jul 30 21:26:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 375043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 B1BFC140174 for ; Thu, 31 Jul 2014 07:26:54 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=iiV/EFc4kilQazbMVqQD3oT6usJJihBQM6NbI+YIOBV5WwcotU8fD wYijMV6/Bjqoho/xAq3OpxUO3CDpWcJFwO6s6+PtmKN6NrUObis3xVme0gaHWv+2 Dn/tHpCdyou9u7BDGupG2AOEOwURuYFnfmO4lHY5yem64fVchBxAWg= 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:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=Bgx99n+M3Y1U5CMYt5T4XfY/pTM=; b=n+qd2NGngVSR5vUFJyXj juyc/pB6lcB+C/ocCn6ALjz2tugtMxdtqcDGOYVKrD2WlWwJhRi+DfTEDvj0+1ZJ +WESgJ7l4QfjbTJcmMks0o4Rq2OPy3HAUazcDqkPVJdXPXiCc+jSs3p8hQtbEKj5 uFz+69pU44WVUV9ei/2jBNo= Received: (qmail 29459 invoked by alias); 30 Jul 2014 21:26:46 -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 29432 invoked by uid 89); 30 Jul 2014 21:26:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 30 Jul 2014 21:26:43 +0000 Received: by mail-wi0-f169.google.com with SMTP id n3so314468wiv.2 for ; Wed, 30 Jul 2014 14:26:40 -0700 (PDT) X-Received: by 10.194.236.35 with SMTP id ur3mr9791772wjc.127.1406755600599; Wed, 30 Jul 2014 14:26:40 -0700 (PDT) Received: from localhost ([95.145.139.85]) by mx.google.com with ESMTPSA id gq4sm13715124wib.8.2014.07.30.14.26.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jul 2014 14:26:39 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: RFA: Remove insn_contains_asm from ira.c Date: Wed, 30 Jul 2014 22:26:38 +0100 Message-ID: <87tx5yilm9.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Just a small clean-up in preparation for the FOR_EACH_SUBRTX patches. insn_contains_asm can be tested more directly using extract_asm_operands, which doesn't involve any subcalls and should therefore be more efficient than calling for_each_rtx. Tested on x86_64-linux-gnu. OK to install? Thanks, Richard gcc/ * ira.c (insn_contains_asm_1, insn_contains_asm): Delete. (compute_regs_asm_clobbered): Use extract_asm_operands instead. Index: gcc/ira.c =================================================================== --- gcc/ira.c 2014-07-30 20:04:53.199301309 +0100 +++ gcc/ira.c 2014-07-30 20:05:28.844636897 +0100 @@ -2221,25 +2221,6 @@ ira_bad_reload_regno (int regno, rtx in, || ira_bad_reload_regno_1 (regno, out)); } -/* Return TRUE if *LOC contains an asm. */ -static int -insn_contains_asm_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -{ - if ( !*loc) - return FALSE; - if (GET_CODE (*loc) == ASM_OPERANDS) - return TRUE; - return FALSE; -} - - -/* Return TRUE if INSN contains an ASM. */ -static bool -insn_contains_asm (rtx insn) -{ - return for_each_rtx (&insn, insn_contains_asm_1, NULL); -} - /* Add register clobbers from asm statements. */ static void compute_regs_asm_clobbered (void) @@ -2253,7 +2234,7 @@ compute_regs_asm_clobbered (void) { df_ref def; - if (insn_contains_asm (insn)) + if (NONDEBUG_INSN_P (insn) && extract_asm_operands (PATTERN (insn))) FOR_EACH_INSN_DEF (def, insn) { unsigned int dregno = DF_REF_REGNO (def);