This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][combine][RFC] Don't transform sign and zero extends inside mults
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 6 Nov 2015 16:00:08 -0600
- Subject: Re: [PATCH][combine][RFC] Don't transform sign and zero extends inside mults
- Authentication-results: sourceware.org; auth=none
- References: <56376FFF dot 3070008 at arm dot com> <20151104235015 dot GA13203 at gate dot crashing dot org> <563B4516 dot 5090001 at arm dot com> <20151106005636 dot GA31412 at gate dot crashing dot org> <563CB6DE dot 7070106 at arm dot com> <563D1824 dot 8000607 at redhat dot com>
[ 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