From patchwork Mon Oct 23 17:21:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116794 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4886890qgn; Mon, 23 Oct 2017 10:21:46 -0700 (PDT) X-Received: by 10.101.74.206 with SMTP id c14mr12390959pgu.190.1508779306113; Mon, 23 Oct 2017 10:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508779306; cv=none; d=google.com; s=arc-20160816; b=gwXVzO+fy75+YWL7qqwh4FFO6XRsAGYKUlJy1bcn8+gCkw4IngPj7ME+NFIka2RkM+ /+lbeaFt5Hp7s6Nk154YRyyWAB0vkJMsajfzonVeKmuxu+SqbYppcWw6/bMa+CGPcu0y NDCTYOJbxyCC+SEtSca/bwGA/ikJdhCfdk48MhLextNEnH3t9RuzZP0E+gSgFJNr8C/Z LbcvcUuSuSFY/SqAHc3/t5wanSatiON6hk5tcYQFgEah59szSP5CgXMcaNC2AlvL8/oX +xE+Soywt/Fjr+mVBxacTy8AFo24Vj0s8IsuYCkAzekRMUz80A1jsibLeYqCEd2VYIsR KvpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=Yjm2ObqCtZYKAUi+FzntWzFiIkv7i8OKtuUIR0gFrYA=; b=DSqzMgj+g1eVaovp/SXKIPPebLZb7UGllRom96kAaIrKiFCSonrlkHjwvNILy6GrPE 2YbIyp8uvpeWWcFSOZAcQHwyKYRoYCwmXN0wCh1P9WvtC3zqGR7E5rKTRDKnXfdEKXya Ra2IsoOqPNMB9x4rsedAJ4s+5z7nn9eXCleNC2UvbwSk0tkfxON0NuG4Nlo/MnVWm0d8 l9XQXT2GHmkdnT2NmGk1rPP2vXiQhJS10jf7j0rGXBxSSQ7HwL0uNwCZmrP8Z5H2fi+1 RMw143RBITC9+pdgO9O8mTUMeEIS5uh9sUiJX+v8mzFvhrWEg+dX3OpX6x8mH0cvtjtR cwKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mFkyKOLc; spf=pass (google.com: domain of gcc-patches-return-464826-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464826-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 11si4282060plc.620.2017.10.23.10.21.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:21:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464826-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mFkyKOLc; spf=pass (google.com: domain of gcc-patches-return-464826-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464826-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=iCEspXv4I+jhG8ZeEL3e5BlXSp8dL 1NHkwex9PWUlTfyl4e6DURfVfghqlY/0sYOkqoDM+s4auI8WvLOA61e3ja+Sud3m GM1dHn3U6LMDhczCyjktQtQKpWgwBXCdw3H7+p+A+OHE1pCgSQW8pfpGvle45j4l I1cPJIPt6pyBqw= 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=zmeXoTAlc0lAz7t/k1KESuFQz6Y=; b=mFk yKOLct1h6jThtICieHAiFOLMZwIexCVUFL9l2GChShdZ0DJAALCi9OIrl8oSSxey 9pnvvml7wUww3bjSyZdcZiYfuNkPSwArfuOzwRgdzfLpGkiLRy8j5c8VTZos3d95 W2zCL1rya8opB+X+777F7M9Am4v9fMo6FDGylQRc= 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-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 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 18:21:20 +0100 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 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)