Richard and Eric, I see you have objected and indicated the additional cost. Have you quantified how much more expensive the pass is?
-----Original Message----- From: Richard Biener [mailto:richard.guent...@gmail.com] Sent: Tuesday, October 17, 2017 4:45 AM To: Eric Botcazou <ebotca...@adacore.com> Cc: Jeff Law <l...@redhat.com>; GCC Patches <gcc-patches@gcc.gnu.org>; Michael Collison <michael.colli...@arm.com>; Segher Boessenkool <seg...@kernel.crashing.org>; Kyrill Tkachov <kyrylo.tkac...@foss.arm.com>; nd <n...@arm.com> Subject: Re: [PATCH][compare-elim] Merge zero-comparisons with normal ops On Sat, Oct 14, 2017 at 10:39 AM, Eric Botcazou <ebotca...@adacore.com> wrote: >> 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... I agree with Eric here. Richard. > -- > Eric Botcazou