generic.texi (ANNOTATE_EXPR): Document 3rd operand.
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 23 Nov 2017 16:36:28 +0000 (16:36 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 23 Nov 2017 16:36:28 +0000 (16:36 +0000)
commitac9effeda3bb29c0adcd8834b45b6e5613413049
tree3f5eec951b1bf6f87260a9f9b1ac709979be8501
parent02a703675c455492a0606579a37d373e9777284c
generic.texi (ANNOTATE_EXPR): Document 3rd operand.

* doc/generic.texi (ANNOTATE_EXPR): Document 3rd operand.
* cfgloop.h (struct loop): Add unroll field.
* function.h (struct function): Add has_unroll bitfield.
* gimplify.c (gimple_boolify) <ANNOTATE_EXPR>: Deal with unroll kind.
(gimplify_expr) <ANNOTATE_EXPR>: Propagate 3rd operand.
* loop-init.c (pass_loop2::gate): Return true if cfun->has_unroll.
(pass_rtl_unroll_loops::gate): Likewise.
* loop-unroll.c (decide_unrolling): Tweak note message.  Skip loops
for which loop->unroll==1.
(decide_unroll_constant_iterations): Use note for consistency and
take loop->unroll into account.  Return early if loop->unroll is set.
Fix thinko in existing test.
(decide_unroll_runtime_iterations): Use note for consistency and
take loop->unroll into account.
(decide_unroll_stupid): Likewise.
* lto-streamer-in.c (input_cfg): Read loop->unroll.
* lto-streamer-out.c (output_cfg): Write loop->unroll.
* tree-cfg.c (replace_loop_annotate_in_block) <annot_expr_unroll_kind>:
        New case.
(replace_loop_annotate) <annot_expr_unroll_kind>: Likewise.
(print_loop): Print loop->unroll if set.
* tree-core.h (enum annot_expr_kind): Add annot_expr_unroll_kind.
* tree-inline.c (copy_loops): Copy unroll and set cfun->has_unroll.
* tree-pretty-print.c (dump_generic_node) <annot_expr_unroll_kind>:
New case.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Bail out if
loop->unroll is set and smaller than the trip count.  Otherwise bypass
entirely the heuristics if loop->unroll is set.  Remove dead note.
Fix off-by-one bug in other note.
(try_peel_loop): Bail out if loop->unroll is set.  Fix formatting.
(tree_unroll_loops_completely_1): Force unrolling if loop->unroll
is greater than 1.
(tree_unroll_loops_completely): Make static.
(pass_complete_unroll::execute): Use correct type for variable.
(pass_complete_unrolli::execute): Fix formatting.
* tree.def (ANNOTATE_EXPR): Add 3rd operand.
ada/
* gcc-interface/trans.c (gnat_gimplify_stmt) <LOOP_STMT>: Pass 3rd
operand to ANNOTATE_EXPR and also pass unrolling hints.
c/
* c-parser.c (c_parser_while_statement): Pass 3rd operand to
ANNOTATE_EXPR.
(c_parser_do_statement): Likewise.
(c_parser_for_statement): Likewise.
cp/
* pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
* semantics.c (finish_while_stmt_cond): Pass 3rd operand to
ANNOTATE_EXPR.
(finish_do_stmt): Likewise.
(finish_for_cond): Likewise.
fortran/
* trans-stmt.c (gfc_trans_forall_loop): Pass 3rd operand to
ANNOTATE_EXPR.

From-SVN: r255106
49 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/trans.c
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cfgloop.h
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/doc/generic.texi
gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c
gcc/function.h
gcc/gimplify.c
gcc/loop-init.c
gcc/loop-unroll.c
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr64277.c
gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-12.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-14.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c
gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c
gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
gcc/testsuite/gcc.dg/tree-ssa/loop-23.c
gcc/testsuite/gcc.dg/tree-ssa/pr61743-1.c
gcc/testsuite/gcc.dg/tree-ssa/pr61743-2.c
gcc/testsuite/gcc.dg/unroll-2.c
gcc/testsuite/gcc.dg/unroll-3.c
gcc/testsuite/gcc.dg/unroll-4.c
gcc/testsuite/gcc.dg/unroll-5.c
gcc/testsuite/gcc.dg/unroll-7.c
gcc/testsuite/gnat.dg/unroll1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/unroll1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/unroll2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/unroll2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/unroll3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/unroll3.ads [new file with mode: 0644]
gcc/tree-cfg.c
gcc/tree-core.h
gcc/tree-inline.c
gcc/tree-pretty-print.c
gcc/tree-ssa-loop-ivcanon.c
gcc/tree.def