[PATCH] Reduce garbage produced by invert_truthvalue
Richard Guenther
rguenther@suse.de
Thu Jun 15 18:50:00 GMT 2006
On Thu, 15 Jun 2006, Roger Sayle wrote:
>
> On Wed, 14 Jun 2006, Richard Guenther wrote:
> > 2006-06-14 Richard Guenther <rguenther@suse.de>
> >
> > * fold-const.c (fold_truth_not_expr): Rename from
> > invert_truthvalue. Give it fold_* semantics to avoid
> > generating garbage.
> > (invert_truthvalue): New function. Wrapper around
> > fold_truth_not_expr.
> > (optimize_minmax_comparison): Avoid creating garbage.
> > (fold_unary): Use fold_truth_not_expr for folding
> > TRUTH_NOT_EXPR.
> > (fold_ternary): Replace uses of invert_truthvalue with
> > fold_truth_not_expr where applicable.
> > * tree.h (fold_truth_not_expr): Prototype.
>
> This is OK for mainline. invert_truthvalue is popular enough to
> show up in GCC's profiles, so reducing its overhead is a good
> thing even in stage3.
>
> ! FIXME: one would think we would fold the result, but it causes
> ! problems with the dominator optimizer. */
>
> Did you check whether this prexisting comment is still true? DOM
> has probably changed significantly since this comment was written,
> and not being able to canonicalize/fold trees may indicate a real
> latent bug somewhere.
No, I didn't check that. Given that we are in stage3 I tried to
minimize observable difference for the patch.
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
More information about the Gcc-patches
mailing list