On Wed, Nov 22, 2017 at 11:41:24AM +0100, Richard Biener wrote: > > I am testing the following (old) patch to value number call lhs > according to the ERF_RETURNS_ARG annotation. This allows for > more expression simplification and also changes downstream > users of the argument to use the return value which should help > register allocation and register lifetime in general.
If the argument is an SSA_NAME then that is generally a win, but won't it also replace if the argument is say ADDR_EXPR of a VAR_DECL or similar? If we only later (say some later forwprop) determine the argument is gimple_min_invariant, shouldn't we have something that will effectively undo this (i.e. replace the uses of the function result with whatever we've simplified the argument to)? Jakub