public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steven at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/54133] regrename introduces additional dependencies
Date: Wed, 01 Aug 2012 11:58:00 -0000	[thread overview]
Message-ID: <bug-54133-4-G3gu0L5xMU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54133-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54133

--- Comment #4 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-01 11:58:00 UTC ---
Created attachment 27918
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27918
Hack regmove to do limited propagation of hard regs

I have a patch to make the propagation happen in regmove, resulting in the
following RTL in the IRA dump:

   78 r177:DF=r0:DF
   80 [sp:SI]=r166:DF
   81 [sp:SI+0x8]=r168:DF
   82 [sp:SI+0x10]=r170:DF
   84 r2:DF=r164:DF
   85 r0:DF=call [`bar'] argc:0x18
      REG_DEAD: r2:DF
      REG_UNUSED: r0:DF
   86 [sp:SI]=r167:DF
   87 [sp:SI+0x8]=r169:DF
   88 [sp:SI+0x10]=r171:DF
   89 r0:DF=r177:DF
      REG_DEAD: r177:DF
   90 r2:DF=r165:DF
   91 r0:DF=call [`bar'] argc:0x18

But now IRA decides to spill r177 to memory:

      Allocno a5r177 of GENERAL_REGS(9) has 4 avail. regs  4-7, node:  4-7 obj
0 (confl regs =  0-3 8-102),  obj 1 (confl regs =  0-3 8-102)

      Pushing a5(r177,l0)(potential spill: pri=469, cost=38000)
        Making a1(r159,l0) colorable
        Making a2(r172,l0) colorable
        Making a3(r163,l0) colorable
      Pushing a1(r159,l0)(cost 32000)
      Pushing a3(r163,l0)(cost 40000)
      Pushing a2(r172,l0)(cost 88000)
      Popping a2(r172,l0)  -- assign reg 4
      Popping a3(r163,l0)  -- assign reg 5
      Popping a1(r159,l0)  -- assign reg 6
      Popping a5(r177,l0)  -- (memory is more profitable 32000 vs 2147483647)
spill
      Popping a0(r175,l0)  -- assign reg 7

This makes the inner loop 2 instructions smaller, but I haven't investigated
whether that's an improvement or not.


  parent reply	other threads:[~2012-08-01 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  6:59 [Bug rtl-optimization/54133] New: " amker.cheng at gmail dot com
2012-07-31  8:01 ` [Bug rtl-optimization/54133] " steven at gcc dot gnu.org
2012-08-01  7:50 ` amker.cheng at gmail dot com
2012-08-01 10:14 ` steven at gcc dot gnu.org
2012-08-01 11:58 ` steven at gcc dot gnu.org [this message]
2012-08-01 13:49 ` amker.cheng at gmail dot com
2012-08-02  7:22 ` ebotcazou at gcc dot gnu.org
2012-08-02 10:18 ` amker.cheng at gmail dot com
2012-09-25  7:45 ` amker.cheng at gmail dot com

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-54133-4-G3gu0L5xMU@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).