This is the mail archive of the
mailing list for the GCC project.
Re: Why scheduler do not re-emit REG_DEAD notes?
- From: Jeff Law <law at redhat dot com>
- To: Konstantin Vladimirov <konstantin dot vladimirov at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 8 Sep 2015 13:10:02 -0600
- Subject: Re: Why scheduler do not re-emit REG_DEAD notes?
- Authentication-results: sourceware.org; auth=none
- References: <CADn89gS_ykSH8zC1za5Vb21TAarcbBM8Q55+jR1bfuvUAu68Xw at mail dot gmail dot com>
On 09/07/2015 10:05 AM, Konstantin Vladimirov wrote:
You can not rely on death notes within the scheduler. That's been in
its design as long as I can remember (circa 1992).
In private backend for GCC 5.2.0, we do have target-specific scheduler
(running in TARGET_SCHED_FINISH hook), that do some instruction
packing/pairing on sched2 and relies on REG_DEAD notes, that should be
But they aren't because inside haifa-sched.c, that is being run first
in the sched2 pass, reemit_notes function processes only REG_SAVE_NOTE
case, and, after this scheduler, some insns with REG_DEAD on register,
say r1, might be moved before previous r1 usage (input dependency
case) and things become totally wrong.
Now I appllied some minimal patch locally to fix it (just added
separate REG_DEAD case).
But may be it is part of design and may be it is generally true, that
we can't rely on correct REG_DEAD notes in platform-specific