This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Unbreak forward simulation of liveness (!)
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Eric Botcazou <ebotcazou at adacore dot com>, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Sun, 08 Nov 2009 16:27:46 +0100
- Subject: [PATCH] Unbreak forward simulation of liveness (!)
Hi all,
this patch is the main reason why I've not yet submitted the patch to
restore memory usage of fwprop. The patch had a regression and I found
time to analyze it only now.
It seems that forward simulation of liveness is totally broken, in that
it never adds a register to the set! So, we get (way) too many dead
registers. In the case of fwprop this would call a missed optimization,
with one single exception: this is PR39543, where the missed propagation
causes reload failures.
The problem is that while scanning forwards, a def will _generate_
liveness! The reason is that during the solution of the problem, the
def had killed liveness towards the top of the basic block; now we have
to assume that liveness was generated and use REG_UNUSED notes to clean
up extra bits.
df_simulate_initialize_forwards is broken in the same way. I have no
time right now to fix it, and it is safe for fwprop, so I would
appreciate if Kenny took a look at it. The simplest way seems to be to
restore DF_LR_TOP/DF_LIVE_TOP, and then use that in fwprop. Possibly
you could make that a changeable flag.
Finally, there's also df_simulate_finalize_forwards, which I think we
can delete (it's just computing DF_LR_OUT in an expensive way).
The patch has been regtested together with the fwprop patch; a full
bootstrap is in progress. Ok when it finishes?
Paolo