From patchwork Wed Sep 11 19:14:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1161258 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-508912-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="ON73Dq18"; 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 46TBRc5q6pz9s7T for ; Thu, 12 Sep 2019 05:14:52 +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=vYoGeYGB8NW/tWG0G23Cp0SGBZB1N 5Ys1jnE8If+BpEBf8KdLOSBm+BOT5fE6bkfvRBOL3UBWx4KDp5KxFt4+DRhhW1rF 3RY9LCnJofVzW929vYGHz86Svf9zyljMnVM0OM6Hl6ahc2ny/choUI9U0t25xik6 cGPl7UMltVe7oI= 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=kGpD9Z2suOdZ1AVSgp/1PsS+6Jo=; b=ON7 3Dq18m3jjUpH6OXgmG6NnpOcNW92+KLu4eEDFINRRC3LmVEYf6E+Q/jlvABhi1Iw vkf6N2Fo1pU0fTVg/SaF4mRtG5tCB4ic+KUTlo2C1nvd/pcnPGLf9RHF1i601iVH VAwXHOLT7RVROAE8iTqriY/gacOcJiysxLE0OqJk= Received: (qmail 13260 invoked by alias); 11 Sep 2019 19:14:36 -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 13208 invoked by uid 89); 11 Sep 2019 19:14:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, 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:14:34 +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 AA5551000 for ; Wed, 11 Sep 2019 12:14:32 -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 52AD53F59C for ; Wed, 11 Sep 2019 12:14:32 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [22/32] Remove global call sets: postreload.c References: Date: Wed, 11 Sep 2019 20:14:31 +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 "|= fixed_regs" in reload_combine isn't necessary, since the set is only used to determine which values have changed (rather than, for example, which registers are available for use). In reload_cse_move2add we can be accurate about which registers are still available. BLKmode indicates a continuation of the previous register, and since clobbers_reg_p handles multi-register values, it's enough to skip over BLKmode entries and just test the start register. 2019-09-11 Richard Sandiford gcc/ * postreload.c (reload_combine_recognize_pattern): Use crtl->abi when deciding whether a register is free for use after RA. (reload_combine): Remove unnecessary use of fixed_reg_set. (reload_cse_move2add): Use call_insn_abi to get the ABI of the call insn target. Use reg_mode when testing whether a register is no longer available. Index: gcc/postreload.c =================================================================== --- gcc/postreload.c 2019-09-11 19:47:24.418262673 +0100 +++ gcc/postreload.c 2019-09-11 19:48:41.905716645 +0100 @@ -1136,7 +1136,8 @@ reload_combine_recognize_pattern (rtx_in if (TEST_HARD_REG_BIT (reg_class_contents[INDEX_REG_CLASS], i) && reg_state[i].use_index == RELOAD_COMBINE_MAX_USES && reg_state[i].store_ruid <= reg_state[regno].use_ruid - && (call_used_or_fixed_reg_p (i) || df_regs_ever_live_p (i)) + && (crtl->abi->clobbers_full_reg_p (i) + || df_regs_ever_live_p (i)) && (!frame_pointer_needed || i != HARD_FRAME_POINTER_REGNUM) && !fixed_regs[i] && !global_regs[i] && hard_regno_nregs (i, GET_MODE (reg)) == 1 @@ -1332,9 +1333,6 @@ reload_combine (void) { rtx link; HARD_REG_SET used_regs = call_insn_abi (insn).full_reg_clobbers (); - /* ??? This preserves traditional behavior; it might not be - needed. */ - used_regs |= fixed_reg_set; for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) if (TEST_HARD_REG_BIT (used_regs, r)) @@ -2126,12 +2124,13 @@ reload_cse_move2add (rtx_insn *first) unknown values. */ if (CALL_P (insn)) { + function_abi abi = call_insn_abi (insn); for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) - { - if (call_used_or_fixed_reg_p (i)) - /* Reset the information about this register. */ - reg_mode[i] = VOIDmode; - } + if (reg_mode[i] != VOIDmode + && reg_mode[i] != BLKmode + && abi.clobbers_reg_p (reg_mode[i], i)) + /* Reset the information about this register. */ + reg_mode[i] = VOIDmode; } } return changed;