From patchwork Tue Jan 16 11:40:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 861425 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-471359-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="U0mJwlU7"; 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 3zLSw70Wgmz9s83 for ; Tue, 16 Jan 2018 22:40:53 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=Txt6Tst9EM3WsHVjDfVm83lrrUQnlqh9gcidbKYj4qlNVU/omO UjfL8gwW6OJHfyplKTmwjMCqDndYp/zp+mKaURvl6OTKCBLqTv/+0llnYU899z8a fm2Ddc0wHKUJNnJDMca7tjLmipBsDO3UVqgb99TQ3BJewkhLqzrqg+6P8= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=Tu9lJvGe1WIh7gbLJ0DF4P3Q0NE=; b=U0mJwlU7e8taGIMUBacW GwM4jEbEFBPkKIiFcz+qlMVZyUjXmJiKNGDuQfCPVNAMAUkLp0o19PNLK9JKLn9e 81XVFAKjqUvJJdBh50mKgUJwzSUBKKcJkGfalhh9LZoWoSkWm1XFVMa79rQq0BaL eq+Qn338nWtsBBUx2CCzwcg= Received: (qmail 60587 invoked by alias); 16 Jan 2018 11:40:46 -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 60561 invoked by uid 89); 16 Jan 2018 11:40:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1708, HX-Received:sk:m90mr24, HX-Received:10.98.63.93, H*RU:209.85.192.193 X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Jan 2018 11:40:40 +0000 Received: by mail-pf0-f193.google.com with SMTP id t12so9534758pfg.2 for ; Tue, 16 Jan 2018 03:40:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=HPDyYTJexoh8p75SmKj2He1E3XMYeA89wfWSx7pgYF8=; b=SR7dw6GnZHFAq/KPUShYt+CVtVo7B9N4j91/1ZKWYE6rWTgHJITpyLBMAUpfS4Ik2O CJCSsUvUMmM6jmoHWu/zpViR7hRG1kbzEdszYrSSh0jFxmSCdPSwfJiijDeWbzeFrD6Q UGMYgs0nxobBRK9SFIkLxD3qaTX1RZNXFkIzAL/TXAI/AG4axlbtWW0WM3BYOToqb37g fR9V8rYAAtDPGKp9idCrnb1LZ5s2chGx5RH2QxmBn+TSRX+VKvRW0G/xHwTvgrtd6aya P/CtKbEvT4ECk3Vy8n9LDl5u2E/TM8Wld/ZXLclMwu8S5dDsEEh/2cbcOJ8ZNCXCjmqU HtUQ== X-Gm-Message-State: AKGB3mICHFwkvJ3ISeu2a87onNVYqwDhvdx2ZV6CeWkMEh6bsthUc3f8 AGDSDro4PEqM4kpI4RIDz78vsg== X-Google-Smtp-Source: ACJfBou7cxh2e8xgNo92fK8MfziANDGKTXdno246xLFA3K7SINkzftP/t2VdNOyxS4cB3yll3ECKIQ== X-Received: by 10.98.63.93 with SMTP id m90mr24676867pfa.231.1516102838887; Tue, 16 Jan 2018 03:40:38 -0800 (PST) Received: from gnu-tools-1.localdomain (c-73-93-86-59.hsd1.ca.comcast.net. [73.93.86.59]) by smtp.gmail.com with ESMTPSA id y131sm3489705pfg.69.2018.01.16.03.40.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jan 2018 03:40:36 -0800 (PST) Received: by gnu-tools-1.localdomain (Postfix, from userid 1000) id 8B23F20AF2; Tue, 16 Jan 2018 03:40:35 -0800 (PST) Date: Tue, 16 Jan 2018 03:40:35 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak , Jan Hubicka Subject: [PATCH] i386: More use reference of struct ix86_frame to avoid copy Message-ID: <20180116114035.GA9373@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes This patch has been used with my Spectre backport for GCC 7 for many weeks and has been checked into GCC 7 branch. Should I revert it on GCC 7 branch or check it into trunk? H.J. --- When there is no need to make a copy of ix86_frame, we can use reference of struct ix86_frame to avoid copy. * config/i386/i386.c (ix86_expand_prologue): Use reference of struct ix86_frame. (ix86_expand_epilogue): Likewise. --- gcc/config/i386/i386.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bfb31db8752..9eba3ffd5d6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13385,7 +13385,6 @@ ix86_expand_prologue (void) { struct machine_function *m = cfun->machine; rtx insn, t; - struct ix86_frame frame; HOST_WIDE_INT allocate; bool int_registers_saved; bool sse_registers_saved; @@ -13413,7 +13412,7 @@ ix86_expand_prologue (void) m->fs.sp_valid = true; m->fs.sp_realigned = false; - frame = m->frame; + struct ix86_frame &frame = cfun->machine->frame; if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl)) { @@ -14291,7 +14290,6 @@ ix86_expand_epilogue (int style) { struct machine_function *m = cfun->machine; struct machine_frame_state frame_state_save = m->fs; - struct ix86_frame frame; bool restore_regs_via_mov; bool using_drap; bool restore_stub_is_tail = false; @@ -14304,7 +14302,7 @@ ix86_expand_epilogue (int style) } ix86_finalize_stack_frame_flags (); - frame = m->frame; + struct ix86_frame &frame = cfun->machine->frame; m->fs.sp_realigned = stack_realign_fp; m->fs.sp_valid = stack_realign_fp