On Tue, Jul 24, 2018 at 04:11:11PM -0300, Alexandre Oliva wrote: > On Jul 24, 2018, Tom de Vries <tdevr...@suse.de> wrote: > > > This patch adds fake uses of user variables at the point where they go out > > of > > scope, to keep user variables inspectable throughout the application. > > I suggest also adding such uses before sets, so that variables aren't > regarded as dead and get optimized out in ranges between the end of a > live range and a subsequent assignment.
But that can be done incrementally, right, and perhaps being controllable by a level of this option, because such extra uses might make it even more costly. Though, if the extra uses and sets aren't in the same stmt, then the optimizers could still move it appart (in addition of it making the IL larger). We need to think about different cases (non-gimple reg vars are probably ok, they just live in memory unless converted (sra etc.) into gimple reg vars, then what to do about SSA_NAMEs with underlying user variable if it doesn't have overlapping ranges, if it does have overlapping ranges). Jakub