From patchwork Tue Sep 10 16:30:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1160454 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-508775-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="HcZHVPx6"; 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 46SVs34pQ2z9s4Y for ; Wed, 11 Sep 2019 02:31:03 +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=o0cXjUxbWUjg6s/Ft6xmsLdFNw0yI pNfIP4SdyMNLviporeO7LeQTwVIKBH/Rp6mum8BC0rdhJJLSG1hLXu0JyG9TbIdd IKUXt9bxA8SHB0udsHn6D08j29wxnxCDhfboIlWAQ6JFvmp/XD64BB8rJfOA0J8f 5BU3qU1JHqruyY= 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=KupFs09Alo9jy6m5gh5eEtkxpHU=; b=HcZ HVPx68zsFHKfvG2oQ7QMG1G4GwhRtFN1HwYTTiKbkSvnrXw8njQtog/Zdp8+98JG tw6Gx2fVZ9rNWJMf9iW2KUCZ79N3h99gwojaH8Q7SOaT+vtjOt2RXqBnyM1zEoXK UfdJcLaLRtnXRVJH3J2bmUu6h1CCTCiNSHqzNfJo= Received: (qmail 94847 invoked by alias); 10 Sep 2019 16:30:30 -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 92615 invoked by uid 89); 10 Sep 2019 16:30:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.1 spammy=amounts 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; Tue, 10 Sep 2019 16:30:17 +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 BBD3B1000 for ; Tue, 10 Sep 2019 09:30:11 -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 637C33F71F for ; Tue, 10 Sep 2019 09:30:11 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [3/9] Remove no_caller_save_reg_set References: Date: Tue, 10 Sep 2019 17:30:10 +0100 In-Reply-To: (Richard Sandiford's message of "Tue, 10 Sep 2019 17:26:13 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Reusing the reasoning from the call_fixed_reg_set patch: for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (j = 1; j <= MOVE_MAX_WORDS; j++) if (reg_save_code (i,regno_save_mode[i][j]) == -1) should be true whenever regno_save_mode[i][j] == VOIDmode, which it is for: ~call_used_reg_set | ~have_save_mode So this condition amounts to: ~call_used_reg_set | ~have_save_mode | ~have_save_insn == ~call_used_reg_set | ~savable_regs no_caller_save_reg_set is then set if call_used_regs[i], so no_caller_save_reg_set is: call_used_reg_set & (~call_used_reg_set | ~savable_regs) == call_used_reg_set & ~savable_regs This patch expands its single user accordingly. Note that ~savable_regs is always empty on LRA targets. 2019-09-10 Richard Sandiford gcc/ * hard-reg-set.h (target_hard_regs::x_no_caller_save_reg_set): Delete. (no_caller_save_reg_set): Delete. * caller-save.c (init_caller_save): Don't initialize it. * ira-conflicts.c (ira_build_conflicts): Calculate no_caller_save_reg_set locally from call_used_reg_set and savable_regs. Index: gcc/hard-reg-set.h =================================================================== --- gcc/hard-reg-set.h 2019-09-10 17:22:37.774467353 +0100 +++ gcc/hard-reg-set.h 2019-09-10 17:22:40.938445344 +0100 @@ -424,10 +424,6 @@ struct target_hard_regs { with the local stack frame are safe, but scant others. */ HARD_REG_SET x_regs_invalidated_by_call; - /* Call used hard registers which cannot be saved because there is no - insn for this. */ - HARD_REG_SET x_no_caller_save_reg_set; - /* Table of register numbers in the order in which to try to use them. */ int x_reg_alloc_order[FIRST_PSEUDO_REGISTER]; @@ -490,8 +486,6 @@ #define savable_regs \ (this_target_hard_regs->x_savable_regs) #define regs_invalidated_by_call \ (this_target_hard_regs->x_regs_invalidated_by_call) -#define no_caller_save_reg_set \ - (this_target_hard_regs->x_no_caller_save_reg_set) #define reg_alloc_order \ (this_target_hard_regs->x_reg_alloc_order) #define inv_reg_alloc_order \ Index: gcc/caller-save.c =================================================================== --- gcc/caller-save.c 2019-09-10 17:22:37.770467379 +0100 +++ gcc/caller-save.c 2019-09-10 17:22:40.938445344 +0100 @@ -192,7 +192,6 @@ init_caller_save (void) caller_save_initialized_p = true; - CLEAR_HARD_REG_SET (no_caller_save_reg_set); /* First find all the registers that we need to deal with and all the modes that they can have. If we can't find a mode to use, we can't have the register live over calls. */ @@ -264,11 +263,7 @@ init_caller_save (void) { regno_save_mode[i][j] = VOIDmode; if (j == 1) - { - CLEAR_HARD_REG_BIT (savable_regs, i); - if (call_used_regs[i]) - SET_HARD_REG_BIT (no_caller_save_reg_set, i); - } + CLEAR_HARD_REG_BIT (savable_regs, i); } } Index: gcc/ira-conflicts.c =================================================================== --- gcc/ira-conflicts.c 2019-09-09 18:59:20.856063253 +0100 +++ gcc/ira-conflicts.c 2019-09-10 17:22:40.938445344 +0100 @@ -765,6 +765,8 @@ ira_build_conflicts (void) } else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0) { + HARD_REG_SET no_caller_save_reg_set + = (call_used_reg_set & ~savable_regs); OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= no_caller_save_reg_set; OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= temp_hard_reg_set; OBJECT_CONFLICT_HARD_REGS (obj) |= no_caller_save_reg_set;