From patchwork Tue Sep 10 16:20:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1160445 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-508770-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="DjlW51UO"; 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 46SVd70MWKz9s4Y for ; Wed, 11 Sep 2019 02:20:42 +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:date:message-id:mime-version:content-type; q=dns; s= default; b=JdrWme8ToG9DzXEkJQSpiwJnitlWYW+JmFrOvsi45DqNGt3Eb+F1p kQf6czE6o8WnRtcnw/RW7xqwp0ipgg18swJ3lsDAPylX34uMWi331zvRrk9nhhUT Xd/sY3syDuPlX/HIIDxv9ehI8Dm7MSAC3Tl6xC3T+/7wCchzEtgURM= 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:date:message-id:mime-version:content-type; s= default; bh=pkcrP4jPdDPbfOExLjGXo4Kgm+4=; b=DjlW51UOpPYVCPE1bTRH /BjXjFu72UHc0kBdh4Hq9IVinxVyaNnIPlzJm7LpY/ZaeYLYdWcXHGJlCcRvZC52 nGIDLM42MtxhienN4pAOfYFGbs1L5/jXubCkadGI6AAp22jwg7zCzr1p5BN3lxM7 zgmSFKxKfFoBEmsTXPTwm1E= Received: (qmail 68553 invoked by alias); 10 Sep 2019 16:20:34 -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 68520 invoked by uid 89); 10 Sep 2019 16:20:33 -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=rtl.h, rtlanalc, rtlh, UD:rtlanal.c 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:20:31 +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 018C61000 for ; Tue, 10 Sep 2019 09:20:30 -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 9C7B43F71F for ; Tue, 10 Sep 2019 09:20:29 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [committed] Make get_call_rtx_from take a const rtx_insn * Date: Tue, 10 Sep 2019 17:20:28 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Only one caller (in dwarf2out.c) was preventing get_call_rtx_from from taking an rtx_insn *. Since that caller just passes a PATTERN, it's a trivial change to make. Tested on aarch64-linux-gnu and x86_64-linux-gnu, applied as obvious. Richard 2019-09-10 Richard Sandiford gcc/ * rtl.h (get_call_rtx_from): Take a const rtx_insn * instead of an rtx. * rtlanal.c (get_call_rtx_from): Likewise. * dwarf2out.c (dwarf2out_var_location): Pass the insn rather than the pattern to get_call_rtx_from. * config/i386/i386-expand.h (ix86_notrack_prefixed_insn_p): Take an rtx_insn * instead of an rtx. * config/i386/i386-expand.c (ix86_notrack_prefixed_insn_p): Likewise. Index: gcc/rtl.h =================================================================== --- gcc/rtl.h 2019-09-09 18:58:51.476270683 +0100 +++ gcc/rtl.h 2019-09-10 17:18:51.156043937 +0100 @@ -3419,7 +3419,7 @@ extern bool nonzero_address_p (const_rtx extern int rtx_unstable_p (const_rtx); extern bool rtx_varies_p (const_rtx, bool); extern bool rtx_addr_varies_p (const_rtx, bool); -extern rtx get_call_rtx_from (rtx); +extern rtx get_call_rtx_from (const rtx_insn *); extern HOST_WIDE_INT get_integer_term (const_rtx); extern rtx get_related_value (const_rtx); extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT); Index: gcc/rtlanal.c =================================================================== --- gcc/rtlanal.c 2019-09-09 18:59:15.996097565 +0100 +++ gcc/rtlanal.c 2019-09-10 17:18:51.164043880 +0100 @@ -811,10 +811,9 @@ rtx_addr_varies_p (const_rtx x, bool for /* Return the CALL in X if there is one. */ rtx -get_call_rtx_from (rtx x) +get_call_rtx_from (const rtx_insn *insn) { - if (INSN_P (x)) - x = PATTERN (x); + rtx x = PATTERN (insn); if (GET_CODE (x) == PARALLEL) x = XVECEXP (x, 0, 0); if (GET_CODE (x) == SET) Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c 2019-09-10 17:18:39.852122587 +0100 +++ gcc/dwarf2out.c 2019-09-10 17:18:51.156043937 +0100 @@ -27505,7 +27505,7 @@ dwarf2out_var_location (rtx_insn *loc_no ca_loc->tail_call_p = SIBLING_CALL_P (prev); /* Look for a SYMBOL_REF in the "prev" instruction. */ - rtx x = get_call_rtx_from (PATTERN (prev)); + rtx x = get_call_rtx_from (prev); if (x) { /* Try to get the call symbol, if any. */ Index: gcc/config/i386/i386-expand.h =================================================================== --- gcc/config/i386/i386-expand.h 2019-05-12 12:25:17.450265496 +0100 +++ gcc/config/i386/i386-expand.h 2019-09-10 17:18:51.152043965 +0100 @@ -50,7 +50,7 @@ rtx ix86_expand_builtin (tree exp, rtx t machine_mode mode, int ignore); bool ix86_vectorize_vec_perm_const (machine_mode vmode, rtx target, rtx op0, rtx op1, const vec_perm_indices &sel); -bool ix86_notrack_prefixed_insn_p (rtx insn); +bool ix86_notrack_prefixed_insn_p (rtx_insn *); machine_mode ix86_split_reduction (machine_mode mode); void ix86_expand_divmod_libfunc (rtx libfunc, machine_mode mode, rtx op0, rtx op1, rtx *quot_p, rtx *rem_p); Index: gcc/config/i386/i386-expand.c =================================================================== --- gcc/config/i386/i386-expand.c 2019-09-05 08:49:30.985738504 +0100 +++ gcc/config/i386/i386-expand.c 2019-09-10 17:18:51.152043965 +0100 @@ -19969,7 +19969,7 @@ ix86_expand_sse2_mulvxdi3 (rtx op0, rtx should be encoded with notrack prefix. */ bool -ix86_notrack_prefixed_insn_p (rtx insn) +ix86_notrack_prefixed_insn_p (rtx_insn *insn) { if (!insn || !((flag_cf_protection & CF_BRANCH))) return false;