This is the mail archive of the gcc-patches@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]

[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


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