This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/n] Handle conditional compare in vrp pass


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]