[ reordered a bit ] On Fri, Nov 06, 2015 at 02:14:12PM -0700, Jeff Law wrote: > On 11/06/2015 07:19 AM, Kyrill Tkachov wrote: > >>>I think we should also add: > >>> && REG_P (XEXP (XEXP (x, 0), 0)) > >>> && REG_P (XEXP (XEXP (x, 1), 0)) > I tend to agree.
> >Indeed, this looks better but it still needs the REG_P checks for the inner > >operands of the extends to not screw up the arm case. > >P.S. Do we want to restrict this to targets that have a widening mul > >optab like I did in the original patch? > I don't think it's necessary or desirable. With the REG_P checks added, now simplification is only stopped for widening muls of registers, so all is fine -- any such construct _is_ a widening multiplication! This patch stops combine from generating widening muls of anything else but registers (immediates, memory, ...). This probably is a reasonable tradeoff for all targets, even those (if any) that have such insns. > >I'll let you put it through it's paces on your setup :) > I'll let Segher give the final yes/no on this, but it generally looks > good to me. It looks okay to me too. Testing now, combine patches have the tendency to do unforeseen things on other targets ;-) Segher