This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [optimize 2/3] Simplify vrp abs conversion
- 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:33:09 +0200 (CEST)
- Subject: Re: [optimize 2/3] Simplify vrp abs conversion
- Authentication-results: sourceware.org; auth=none
- References: <55C91C2D dot 7040407 at acm dot org>
On Mon, 10 Aug 2015, Nathan Sidwell wrote:
> Richard,
> in looking at how simplify_abs_using_ranges was doing its thing as a guide to
> a min/max vrp optimization, I noticed it was doing more work than necessary.
>
> Firstly, it wasn't taking advantage of the range comparison functions only
> returning TRUE or FALSE nodes when there's a definite answer, and NULL
> otherwise. Thus if we get a node, we don't have to (a) check if it's either
> true or false and (b) we only need to check for one of those values to
> determine which specific answer was given.
>
> Also, it was checking for 'NOT (A >= B)' by inverting the result of a '>='
> check, rather than simply doing a '<' check. (we're dealing with integer
> ranges, so that's all well defined)
>
> Finally, there's a useless check for UNSIGNED_TYPE, which ends up doing
> nothing. AFAICT 'ABS (unsigned)' gets folded out very early on.
>
> booted and tested with the phi-min-max fix I just posted and the new
> VRP-min-max optimization I'm about to.
>
> ok?
Ok.
Thanks,
Richard.