Generalized IPA predicate on parameter reference
authorFeng Xue <fxue@os.amperecomputing.com>
Wed, 16 Oct 2019 07:27:50 +0000 (07:27 +0000)
committerFeng Xue <fxue@gcc.gnu.org>
Wed, 16 Oct 2019 07:27:50 +0000 (07:27 +0000)
commit4307a485c39fd1c317d6cead2707a903052c4753
tree43e805a49dee12ec7f12a720d4e87a8a6ef39ed5
parent8cf9bbd2476bbacdcb8bc51ea2b2c020f3ea0168
Generalized IPA predicate on parameter reference

2019-10-16  Feng Xue  <fxue@os.amperecomputing.com>

        PR ipa/91088
        * doc/invoke.texi (ipa-max-param-expr-ops): Document new option.
        * params.def (PARAM_IPA_MAX_PARAM_EXPR_OPS): New.
        * ipa-predicat.h (struct expr_eval_op): New struct.
        (expr_eval_ops): New typedef.
        (struct condition): Add type and param_ops fields, remove size field.
        (add_condition): Replace size parameter with type parameter, add
        param_ops parameter.
        * ipa-predicat.c (expr_eval_ops_equal_p): New function.
        (predicate::add_clause): Add comparisons on type and param_ops.
        (dump_condition): Add debug dump for param_ops.
        (remap_after_inlining): Adjust call arguments to add_condition.
        (add_condition): Replace size parameter with type parameter, add
        param_ops parameter. Unshare constant value used in conditions.
        * ipa-fnsummary.c (evaluate_conditions_for_known_args): Fold
        parameter expressions using param_ops.
        (decompose_param_expr):  New function.
        (set_cond_stmt_execution_predicate): Use call to decompose_param_expr
        to replace call to unmodified_parm_or_parm_agg_item.
        (set_switch_stmt_execution_predicate): Likewise.
        (will_be_nonconstant_expr_predicate): Likewise. Replace usage of size
        with type.
        (inline_read_section): Read param_ops from summary stream.
        (ipa_fn_summary_write): Write param_ops to summary stream.

2019-10-16  Feng Xue  <fxue@os.amperecomputing.com>

        PR ipa/91088
        * gcc.dg/ipa/pr91088.c: New test.
        * gcc.dg/ipa/pr91089.c: Add sub-test for range analysis.
        * g++.dg/tree-ssa/ivopts-3.C: Force a function to be noinline.

From-SVN: r277054
gcc/ChangeLog
gcc/doc/invoke.texi
gcc/ipa-fnsummary.c
gcc/ipa-predicate.c
gcc/ipa-predicate.h
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C
gcc/testsuite/gcc.dg/ipa/pr91088.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ipa/pr91089.c