public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR target/81313: Use DRAP only if there are outgoing arguments on stack
Date: Sun, 09 Jul 2017 18:19:00 -0000	[thread overview]
Message-ID: <CAFULd4YGe2YrY4+28LHuTew7rZrFhv-9qaiXaV+pU+eFna_+ng@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOqwMsniFna_bNcCc-RyVzpbnbnRoSt2ypg18-fdpVq+6Q@mail.gmail.com>

On Fri, Jul 7, 2017 at 12:14 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Jul 6, 2017 at 12:08 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> Since DRAP is needed only if there are outgoing arguments on stack, we
>> should track outgoing arguments on stack and avoid setting need_drap to
>> true when there are no outgoing arguments on stack.
>>
>> Tested on i686 and x86-64 with SSE2, AVX and AVX2.  There is no
>> regression.  OK for trunk?
>>
>> H.J.
>> ---
>> gcc/
>>
>>         PR target/81313
>>         * config/i386/i386.c (ix86_function_arg_advance): Set
>>         outgoing_args_on_stack to true if there are outgoing arguments
>>         on stack.
>>         (ix86_function_arg): Likewise.
>>         (ix86_get_drap_rtx): Use DRAP only if there are outgoing
>>         arguments on stack and ACCUMULATE_OUTGOING_ARGS is false.
>>         * config/i386/i386.h (machine_function): Add
>>         outgoing_args_on_stack.
>>
>> @@ -10473,6 +10479,10 @@ ix86_function_arg (cumulative_args_t cum_v, machine_mode omode,
>>    else
>>      arg = function_arg_32 (cum, mode, omode, type, bytes, words);
>>
>> +  /* Track if there are outgoing arguments on stack.  */
>> +  if (arg == NULL_RTX)
>> +    cfun->machine->outgoing_args_on_stack = true;
>
> This should be
>
> +  /* Track if there are outgoing arguments on stack.  */
> +  if (arg == NULL_RTX && cum->caller)
> +    cfun->machine->outgoing_args_on_stack = true;
>
> to check outgoing arguments for caller here.
>
>>    return arg;
>>  }
>>
>>
>
> I am testing updated patch with a new testcase.

Updated patch LGTM.

OK for mainline.

Thanks,
Uros.

  reply	other threads:[~2017-07-09 18:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 19:08 H.J. Lu
2017-07-06 22:14 ` H.J. Lu
2017-07-09 18:19   ` Uros Bizjak [this message]
2017-07-09 18:29     ` H.J. Lu
2017-07-09 18:57       ` Uros Bizjak
2017-07-09 19:06         ` H.J. Lu
2017-07-09 19:12           ` Uros Bizjak
2017-07-09 20:53         ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFULd4YGe2YrY4+28LHuTew7rZrFhv-9qaiXaV+pU+eFna_+ng@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).