From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 655 invoked by alias); 11 Sep 2019 19:11:56 -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 646 invoked by uid 89); 11 Sep 2019 19:11:56 -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=HX-Languages-Length:1567, kills 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:11:54 +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 7872A28 for ; Wed, 11 Sep 2019 12:11:53 -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 20DBF3F59C for ; Wed, 11 Sep 2019 12:11:53 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [17/32] Remove global call sets: gcse.c References: Date: Wed, 11 Sep 2019 19:11:00 -0000 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 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00797.txt.bz2 This is another case in which we can conservatively treat partial kills as full kills. Again this is in principle a bug fix for TARGET_HARD_REGNO_CALL_PART_CLOBBERED targets, but in practice it probably doesn't make a difference. 2019-09-11 Richard Sandiford gcc/ * gcse.c: Include function-abi.h. (compute_hash_table_work): Use call_insn_abi to get the ABI of the call insn target. Invalidate partially call-clobbered registers as well as fully call-clobbered ones. Index: gcc/gcse.c =================================================================== --- gcc/gcse.c 2019-09-09 18:58:51.468270740 +0100 +++ gcc/gcse.c 2019-09-11 19:48:23.453846664 +0100 @@ -160,6 +160,7 @@ Software Foundation; either version 3, o #include "dbgcnt.h" #include "gcse.h" #include "gcse-common.h" +#include "function-abi.h" /* We support GCSE via Partial Redundancy Elimination. PRE optimizations are a superset of those done by classic GCSE. @@ -1527,9 +1528,14 @@ compute_hash_table_work (struct gcse_has if (CALL_P (insn)) { + function_abi abi = call_insn_abi (insn); hard_reg_set_iterator hrsi; - EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, - 0, regno, hrsi) + + /* We don't track modes of hard registers, so we need + to be conservative and assume that partial kills + are full kills. */ + const_hard_reg_set clob = abi.full_and_partial_reg_clobbers (); + EXECUTE_IF_SET_IN_HARD_REG_SET (clob, 0, regno, hrsi) record_last_reg_set_info (insn, regno); if (! RTL_CONST_OR_PURE_CALL_P (insn)