This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why scheduler do not re-emit REG_DEAD notes?
- From: Konstantin Vladimirov <konstantin dot vladimirov at gmail dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 7 Sep 2015 19:05:54 +0300
- Subject: Why scheduler do not re-emit REG_DEAD notes?
- Authentication-results: sourceware.org; auth=none
Hi,
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
correct.
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
scheduler?
---
With best regards, Konstantin