This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [optimize3/3] VRP min/max exprs
- From: Richard Biener <rguenther at suse dot de>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Aug 2015 13:41:31 +0200 (CEST)
- Subject: Re: [optimize3/3] VRP min/max exprs
- Authentication-results: sourceware.org; auth=none
- References: <55C91F7D dot 5080604 at acm dot org>
On Mon, 10 Aug 2015, Nathan Sidwell wrote:
> Richard.
> this is the patch for the min/max optimization I was trying to implement
> before getting sidetracked with the phi bug and cleaning the vrp abs
> optimization.
>
> This patch checks both min and max where both operands have a determined
> range, and the case where the second op is a constant. When we determine the
> operand values are disjoint (modulo a possible single overlapping value) we
> replace the min or max with the appropriate operand.
>
> booted and tested with the other two patches I just posted.
>
> ok?
The patch looks good. Note that with SSA name operands it can be
still profitable to do compare_range_with_value, esp. if the other
operand has a symbolical range. See
vrp_evaluate_conditional_warnv_with_ops_using_ranges which actually
implements a nice helper for evaluating comparisons for code-gen
transforms.
So I'd prefer that you'd simply call that instead of deciding for
yourself on SSA name vs. non-SSA name.
Thanks,
Richard.