This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/n] Handle conditional compare in vrp pass
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Zhenqiang Chen <zhenqiang dot chen at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 30 Aug 2013 10:34:25 +0200
- Subject: Re: [PATCH 3/n] Handle conditional compare in vrp pass
- Authentication-results: sourceware.org; auth=none
- References: <000001cea555$b36580a0$1a3081e0$ at arm dot com>
On Fri, Aug 30, 2013 at 9:51 AM, Zhenqiang Chen <zhenqiang.chen@arm.com> wrote:
> Hi,
>
> The patch updates vrp pass to handle conditional compare (CCMP).
>
> CCMP is a combine of BIT_AND_EXPR/BIT_IOR_EXPR and CMP expression. The codes
> are similar with those to handle BIT_AND_EXPR/BIT_IOR_EXPR and CMP
> expression.
Btw, this is exactly why it's backward to do it this way. We finally succeeded
in dropping TRUTH_AND/OR/..._EXPR in favor of lowering them to
BIT_AND/OR/..._EXPR so passes need only handle _one_ variant. Now you
introduce another that all passes need to handle.
As far as I can see you only need those "combined" expressions at RTL
expansion time.
Richard.
> When the compare in CCMP can be simplified, CCMP will be converted to a
> copy,
> compare or a bit operator.
>
> Bootstrap on x86-64 and ARM Chromebook.
> No ICE and runtime errors in regression tests.
> All "vrp" related test cases PASS.
>
> Thanks!
> -Zhenqiang
>
> ChangeLog:
> 2013-08-30 Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
> * tree-vrp.c (extract_range_from_assignment,
> register_edge_assert_for,
> simplify_stmt_using_ranges): Handle conditional compare.
> (extract_range_from_comparison, can_simplify_ops_using_ranges_p,
> simplify_ccmp_to_cmp, simple_ccmp_second_compare,
> simplify_ccmp_to_op,
> simplify_ccmp_stmt_using_ranges): New added.
>
> testsuite/ChangeLog:
> 2013-08-30 Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
> * gcc.dg/tree-ssa/ccmp*.c: New test cases.