From patchwork Wed Sep 11 19:10:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1161250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-508903-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QPv1HL+7"; dkim-atps=neutral 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 46TBLh3dhdz9s7T for ; Thu, 12 Sep 2019 05:10:36 +1000 (AEST) 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:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=tIjxlMGIgbSpbttQU9QtKiz1XTnJ0 45xYqhHhwkPQYxmgVvR6CxLn7UFfEzPSdL8lbKqnAJM1EedY8qD9rzoObV3UbsLi Bj7HPlSsBdYpTQsYx8AQRikslYzZlxNeDq6srjyti7E37DyHxFckYU5GHCVLDYUk BEgVBhNK72XUmw= 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:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=7SMq/LmdLHC3ORhOBdlpjkar08g=; b=QPv 1HL+7W2quIiGCrNfUCqC8pPeQRsYZy50pZpr6O0PQSR1dic4XcxGQOf7Lo5nzxnZ EcUgV+aUD5OiQOPY1ckrY0mEXelyPipweKiHQat/G9DONZ5hqnhCiDWvsBecOR7l s9SGBL1p8C0YPqtdiL0cyzIndjZWHFfRObJQny6o= Received: (qmail 98977 invoked by alias); 11 Sep 2019 19:10:29 -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 98969 invoked by uid 89); 11 Sep 2019 19:10:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2019 19:10:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EB6DF28 for ; Wed, 11 Sep 2019 12:10:26 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.99.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93D093F59C for ; Wed, 11 Sep 2019 12:10:26 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [14/32] Remove global call sets: DF (entry/exit defs) References: Date: Wed, 11 Sep 2019 20:10:25 +0100 In-Reply-To: (Richard Sandiford's message of "Wed, 11 Sep 2019 20:02:26 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes The code patched here is seeing whether the current function needs to save at least part of a register before using it. 2019-09-11 Richard Sandiford gcc/ * df-scan.c (df_get_entry_block_def_set): Use crtl->abi to test whether the current function needs to save at least part of a register before using it. (df_get_exit_block_use_set): Likewise for epilogue restores. Index: gcc/df-scan.c =================================================================== --- gcc/df-scan.c 2019-09-11 19:48:07.405959747 +0100 +++ gcc/df-scan.c 2019-09-11 19:48:11.009934354 +0100 @@ -3499,7 +3499,9 @@ df_get_entry_block_def_set (bitmap entry /* Defs for the callee saved registers are inserted so that the pushes have some defining location. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if ((call_used_or_fixed_reg_p (i) == 0) && (df_regs_ever_live_p (i))) + if (!crtl->abi->clobbers_full_reg_p (i) + && !fixed_regs[i] + && df_regs_ever_live_p (i)) bitmap_set_bit (entry_block_defs, i); } @@ -3672,8 +3674,9 @@ df_get_exit_block_use_set (bitmap exit_b { /* Mark all call-saved registers that we actually used. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (df_regs_ever_live_p (i) && !LOCAL_REGNO (i) - && !TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) + if (df_regs_ever_live_p (i) + && !LOCAL_REGNO (i) + && !crtl->abi->clobbers_full_reg_p (i)) bitmap_set_bit (exit_block_uses, i); }