From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7146 invoked by alias); 23 Oct 2017 17:21:26 -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 7029 invoked by uid 89); 23 Oct 2017 17:21:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=46157 X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:21:24 +0000 Received: by mail-wr0-f177.google.com with SMTP id l8so5295402wre.12 for ; Mon, 23 Oct 2017 10:21:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Yjm2ObqCtZYKAUi+FzntWzFiIkv7i8OKtuUIR0gFrYA=; b=m2RNzXZFSHMTgC4H4akjJk8AJwYBlErOttUTaeu5d1WBW21OiO5AHghm06zLjAyJRR QS2c/ymtku0QwUKkG3Q+yK2CFNyPpAA11ERdRMZ1H/7bDCjXgcOwC97KCw9F8sT6AaGh u/QtIbeTROLYt0dOEA1dbwR/2bYlvFDZKL9yTcI80CEUPzlVef7bxAYzkan2JnuCaUmY ku7j/7bBwXZx+SBmjcYcsOjfNPVf8ALBSVWoXcK67+MdHAvg2fk+aF70GeK+oIneu98M 3TMOsob7VJpihXZ0bvwhqyuL8Q4QylkajTkm5UM8n2lvaarWMU/CXuj6R2cElUs+6QWk J8pw== X-Gm-Message-State: AMCzsaXWpK4YjX5IOug0IKzgtpRa+517/5GiplOdrg5Limsom4J7Pos7 RrAdK53HiPXuB+XLgeofscDs5t54MRE= X-Google-Smtp-Source: ABhQp+RspDGWfP5KtlDP9S5x+EJvd2CnukZ6TPqObPwg+AEPNSA7jq6PVzPHqJteFeTtcY88ShSP5A== X-Received: by 10.223.132.135 with SMTP id 7mr12675426wrg.74.1508779282069; Mon, 23 Oct 2017 10:21:22 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id k9sm10606497wrk.88.2017.10.23.10.21.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:21:21 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [050/nnn] poly_int: reload<->ira interface References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 17:21:00 -0000 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87vaj5lqzz.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01551.txt.bz2 This patch uses poly_int64 for: - ira_reuse_stack_slot - ira_mark_new_stack_slot - ira_spilled_reg_stack_slot::width all of which are part of the IRA/reload interface. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * ira-int.h (ira_spilled_reg_stack_slot::width): Change from an unsigned int to a poly_uint64. * ira.h (ira_reuse_stack_slot, ira_mark_new_stack_slot): Take the sizes as poly_uint64s rather than unsigned ints. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Likewise. Index: gcc/ira-int.h =================================================================== --- gcc/ira-int.h 2017-10-23 16:52:18.222670182 +0100 +++ gcc/ira-int.h 2017-10-23 17:20:48.204761416 +0100 @@ -604,7 +604,7 @@ struct ira_spilled_reg_stack_slot /* RTL representation of the stack slot. */ rtx mem; /* Size of the stack slot. */ - unsigned int width; + poly_uint64_pod width; }; /* The number of elements in the following array. */ Index: gcc/ira.h =================================================================== --- gcc/ira.h 2017-10-23 17:10:45.257213436 +0100 +++ gcc/ira.h 2017-10-23 17:20:48.204761416 +0100 @@ -200,8 +200,8 @@ extern void ira_mark_allocation_change ( extern void ira_mark_memory_move_deletion (int, int); extern bool ira_reassign_pseudos (int *, int, HARD_REG_SET, HARD_REG_SET *, HARD_REG_SET *, bitmap); -extern rtx ira_reuse_stack_slot (int, unsigned int, unsigned int); -extern void ira_mark_new_stack_slot (rtx, int, unsigned int); +extern rtx ira_reuse_stack_slot (int, poly_uint64, poly_uint64); +extern void ira_mark_new_stack_slot (rtx, int, poly_uint64); extern bool ira_better_spill_reload_regno_p (int *, int *, rtx, rtx, rtx_insn *); extern bool ira_bad_reload_regno (int, rtx, rtx); Index: gcc/ira-color.c =================================================================== --- gcc/ira-color.c 2017-10-23 17:11:40.005487591 +0100 +++ gcc/ira-color.c 2017-10-23 17:20:48.204761416 +0100 @@ -4495,8 +4495,8 @@ ira_reassign_pseudos (int *spilled_pseud TOTAL_SIZE. In the case of failure to find a slot which can be used for REGNO, the function returns NULL. */ rtx -ira_reuse_stack_slot (int regno, unsigned int inherent_size, - unsigned int total_size) +ira_reuse_stack_slot (int regno, poly_uint64 inherent_size, + poly_uint64 total_size) { unsigned int i; int slot_num, best_slot_num; @@ -4509,8 +4509,8 @@ ira_reuse_stack_slot (int regno, unsigne ira_assert (! ira_use_lra_p); - ira_assert (inherent_size == PSEUDO_REGNO_BYTES (regno) - && inherent_size <= total_size + ira_assert (must_eq (inherent_size, PSEUDO_REGNO_BYTES (regno)) + && must_le (inherent_size, total_size) && ALLOCNO_HARD_REGNO (allocno) < 0); if (! flag_ira_share_spill_slots) return NULL_RTX; @@ -4533,8 +4533,8 @@ ira_reuse_stack_slot (int regno, unsigne slot = &ira_spilled_reg_stack_slots[slot_num]; if (slot->mem == NULL_RTX) continue; - if (slot->width < total_size - || GET_MODE_SIZE (GET_MODE (slot->mem)) < inherent_size) + if (may_lt (slot->width, total_size) + || may_lt (GET_MODE_SIZE (GET_MODE (slot->mem)), inherent_size)) continue; EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs, @@ -4586,7 +4586,7 @@ ira_reuse_stack_slot (int regno, unsigne } if (x != NULL_RTX) { - ira_assert (slot->width >= total_size); + ira_assert (must_ge (slot->width, total_size)); #ifdef ENABLE_IRA_CHECKING EXECUTE_IF_SET_IN_BITMAP (&slot->spilled_regs, FIRST_PSEUDO_REGISTER, i, bi) @@ -4615,7 +4615,7 @@ ira_reuse_stack_slot (int regno, unsigne TOTAL_SIZE was allocated for REGNO. We store this info for subsequent ira_reuse_stack_slot calls. */ void -ira_mark_new_stack_slot (rtx x, int regno, unsigned int total_size) +ira_mark_new_stack_slot (rtx x, int regno, poly_uint64 total_size) { struct ira_spilled_reg_stack_slot *slot; int slot_num; @@ -4623,7 +4623,7 @@ ira_mark_new_stack_slot (rtx x, int regn ira_assert (! ira_use_lra_p); - ira_assert (PSEUDO_REGNO_BYTES (regno) <= total_size); + ira_assert (must_le (PSEUDO_REGNO_BYTES (regno), total_size)); allocno = ira_regno_allocno_map[regno]; slot_num = -ALLOCNO_HARD_REGNO (allocno) - 2; if (slot_num == -1)