This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r231669 - /branches/google/gcc-4_9/gcc/ira-color.c


Author: wmi
Date: Wed Dec 16 00:49:32 2015
New Revision: 231669

URL: https://gcc.gnu.org/viewcvs?rev=231669&root=gcc&view=rev
Log:
In r216697, when a hardreg is assigned to an allocno, a positive cost
will be added to those conflict allocnos to reflect the disfavor of
the hardreg.

However, the fact that conflict allocno disfavors a hard_regno doesn't
necessarily mean current allocno should prefer the hard_regno, so it
is incorrect to update the costs of an allocno directly according to
its conflict allocnos. The patch changes the code to update costs[i]
of an allocno only when conflict_costs[i] < 0, .i.e, when conflict
allocno prefer hardreg i.

Another issue is the costs of an allocno is updated only when the
conflict allocno is not marked as may_be_spilled_p. However, even if a
conflict allocno is marked as may_be_spilled_p right now, it still has
high probablity to get colored later. It is not right to ignore the
preferences from those conflict allocnos marked as may_be_spilled_p.
The patch changes it.

2015-12-10  Wei Mi  <wmi@google.com>

        * ira-color.c (restore_costs_from_conflicts): Don't record the
        cost change.
        (update_conflict_hard_regno_costs): Update costs[i] only when
        conflict_costs[i] < 0.
        (assign_hard_reg): Ditto.

Modified:
    branches/google/gcc-4_9/gcc/ira-color.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]