This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][compare-elim] Merge zero-comparisons with normal ops
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Michael Collison <Michael dot Collison at arm dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, nd <nd at arm dot com>
- Date: Sat, 14 Oct 2017 10:39:03 +0200
- Subject: Re: [PATCH][compare-elim] Merge zero-comparisons with normal ops
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR0802MB2377CC3CF0D995F4BC869D2595880@HE1PR0802MB2377.eurprd08.prod.outlook.com> <HE1PR0802MB2377818A883A7B663207D6B395970@HE1PR0802MB2377.eurprd08.prod.outlook.com> <07ed2aa1-263d-a8f4-5603-47ef5b96e425@redhat.com>
> This looks good. OK for the trunk.
FWIW I disagree. The patch completely shuns the existing implementation of
the pass, which is based on a forward scan within basic blocks to identify the
various interesting instructions and record them, and uses full-blown def-use
and use-def chains instead, which are much more costly to compute. It's not
clear to me why the existing implementation couldn't have been extended.
The result is that, for targets for which the pass was initially written, i.e.
targets for which most (all) arithmetic instructions clobber the flags, the
pass will be slower for absolutely no benefits, as the existing implementation
would already have caught all the interesting cases.
So it's again a case of a generic change made for a specific target without
consideration for other, admittedly less mainstream, targets...
--
Eric Botcazou