public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/65862] [MIPS] IRA/LRA issue: integers spilled to floating-point registers
Date: Mon, 27 Apr 2015 16:17:00 -0000	[thread overview]
Message-ID: <bug-65862-4-ZgSdu2yMKz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65862-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65862

Vladimir Makarov <vmakarov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at gcc dot gnu.org

--- Comment #3 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
  The result of the old patch which makes ALL_REGS available changes
the order of coloring and, as a consequence, the result of allocation for r218
and r220 after IRA.  That is unfortunate result of heuristics approaches.

Before the patch:
      ...
      Popping a4(r218,l0)  -- assign reg 30
      Popping a0(r220,l0)  -- spill
      ...
Disposition:
    ... 4:r218 l0    30    6:r219 l0    16    0:r220 l0   mem

After patch:
      Popping a0(r220,l0)  -- assign reg 30
      Popping a4(r218,l0)  -- (memory is more profitable 184 vs 191) spill!
      ...
Disposition:
    ... 4:r218 l0   mem    6:r219 l0    16    0:r220 l0    30

The costs of MEM and FP_REGS are the same as for example r218 occurs in 2
insns:

59: r218:SI=r194:SI<=0x1
16: pc={(r218:SI!=0)?L18:pc}

The costs are equal if cost of moving general regs to/from fp regs or
memory are equal.  So it looks ok to me.

r218 spilled in IRA is reassigned to a fp reg in *LRA*.  It could be
changed if we used only preferred class in LRA for this.  In this
case, r218 stays spilled and we remove one insn (saving the allocated
fp reg):

        sdc1    $f20,64($sp)

I am not sure, that the result code is better as we access memory 3
times instead of access to $f20.

But I could try to use preferred class in LRA (after checking how it
affects x86/x86-64 performance), if such solution is ok for you.

But I can not just revert the patch making ALL_REGS available to make
coloring heuristic more fotunate for your particular case, as it
reopens the old PR for which the patch was created and i have no other
solutions for the old PR.

Robert, please let me know what do you think.


  parent reply	other threads:[~2015-04-27 16:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 16:04 [Bug rtl-optimization/65862] New: " robert.suchanek at imgtec dot com
2015-04-23 16:09 ` [Bug rtl-optimization/65862] " pinskia at gcc dot gnu.org
2015-04-23 16:54 ` robert.suchanek at imgtec dot com
2015-04-27 16:17 ` vmakarov at gcc dot gnu.org [this message]
2015-04-27 17:13 ` wdijkstr at arm dot com
2015-05-06 16:13 ` robert.suchanek at imgtec dot com
2015-05-06 16:21 ` matthew.fortune at imgtec dot com
2015-05-07 18:55 ` vmakarov at gcc dot gnu.org
2015-05-08 18:29 ` vmakarov at gcc dot gnu.org
2015-05-12 20:38 ` vmakarov at gcc dot gnu.org
2015-05-13  7:53 ` robert.suchanek at imgtec dot com
2015-05-14 14:20 ` wdijkstr at arm dot com
2015-05-14 20:41 ` vmakarov at gcc dot gnu.org

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=bug-65862-4-ZgSdu2yMKz@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).