On Mon, Jan 16, 2017 at 08:23:32AM +0100, Richard Biener wrote: > > I think it is not as bad. I think the problem is only when you > > force_operand 1) after expansion 2) with complicated expression. > > I think if you force_operand just with something that appears in some insn, > > it is very unlikely it will create something significantly more complex. > > It is just the case where something constructs a complex RTX expression and > > then produces insns using the force_operand. In the doloop case, it is > > desc->niter_expr expression, where possibly several insns in the IL together > > are used to compute the niter_expr. Or another case could be when using > > content of REG_EQUAL note and trying to force_operand it. > > Maybe we want to have a force_operand_and_unshare () function then?
Not sure. 1) grepped around and this has been the only place that calls force_operand where the unsharing is known to be needed (perhaps so far). Other places use expand_simple_* (multiple), etc. directly 2) for the unsharing, it is good to know if the expression(s) you are forcing appear or may appear somewhere else in the IL or not. Such information wouldn't be known by force_operand_and_unshare, so it would always have to unshare everything, even if it occurs just once in the sequence. Jakub