From patchwork Wed Oct 27 06:34:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xionghu Luo X-Patchwork-Id: 46693 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5663C3857422 for ; Wed, 27 Oct 2021 06:40:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5663C3857422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635316834; bh=30eklrnkBAp7TkQdNJaFtwLQ5k/JWSz1JPTlQR0qiZA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=VREQi15VM2VKYU8jmkeULsKqYNBtknMZhbp1pr0ApMVC9wa/mNgD0LEYT/ibNxP/g +5ExC3gA8qvJMbCXrR4ofsZ2jMEp4QZxG8T8ZM5o9A4lysMG9cdU979SaZt+zpoQrn aXZWqSKs98xwsM2z9XBp+/k+xHY1K2uEjulufvpE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 53630385702C; Wed, 27 Oct 2021 06:36:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53630385702C Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19R5Mk1A034870; Wed, 27 Oct 2021 06:36:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3by0jrsget-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Oct 2021 06:36:06 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19R6a58n019120; Wed, 27 Oct 2021 06:36:05 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3by0jrsgdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Oct 2021 06:36:05 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19R6SP1x014247; Wed, 27 Oct 2021 06:36:03 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 3bx4epu6nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 27 Oct 2021 06:36:02 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19R6Trbc61669800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Oct 2021 06:29:53 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 697044C052; Wed, 27 Oct 2021 06:35:59 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F39304C044; Wed, 27 Oct 2021 06:35:57 +0000 (GMT) Received: from marlin.aus.stglabs.ibm.com (unknown [9.40.194.84]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 27 Oct 2021 06:35:57 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 4/4] Rename duplicate_loop_to_header_edge to duplicate_loop_body_to_header_edge Date: Wed, 27 Oct 2021 01:34:48 -0500 Message-Id: <20211027063448.1844771-5-luoxhu@linux.ibm.com> X-Mailer: git-send-email 2.27.0.90.geebb51ba8c In-Reply-To: <20211027063448.1844771-1-luoxhu@linux.ibm.com> References: <20211027063448.1844771-1-luoxhu@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: o047_smofh6fl8Tf3PkLMJ_JcpFDbd3v X-Proofpoint-ORIG-GUID: 7pfQt-ZzEvQDmRhurR2cOMQxoK_Yqu_N X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-27_02,2021-10-26_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 mlxlogscore=954 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2110270038 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Xionghu Luo via Gcc-patches From: Xionghu Luo Reply-To: Xionghu Luo Cc: rguenther@suse.de, segher@kernel.crashing.org, Xionghu Luo , hubicka@kam.mff.cuni.cz, wschmidt@linux.ibm.com, linkw@gcc.gnu.org, dje.gcc@gmail.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * cfghooks.c (cfg_hook_duplicate_loop_to_header_edge): Rename duplicate_loop_to_header_edge to duplicate_loop_body_to_header_edge. (cfg_hook_duplicate_loop_body_to_header_edge): Likewise. * cfghooks.h (struct cfg_hooks): Likewise. (cfg_hook_duplicate_loop_body_to_header_edge): Likewise. * cfgloopmanip.c (duplicate_loop_body_to_header_edge): Likewise. (clone_loop_to_header_edge): Likewise. * cfgloopmanip.h (duplicate_loop_body_to_header_edge): Likewise. * cfgrtl.c (struct cfg_hooks): Likewise. * doc/loop.texi: Likewise. * loop-unroll.c (unroll_loop_constant_iterations): Likewise. (unroll_loop_runtime_iterations): Likewise. (unroll_loop_stupid): Likewise. (apply_opt_in_copies): Likewise. * tree-cfg.c (struct cfg_hooks): Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. (try_peel_loop): Likewise. * tree-ssa-loop-manip.c (copy_phi_node_args): Likewise. (gimple_duplicate_loop_body_to_header_edge): Likewise. (tree_transform_and_unroll_loop): Likewise. * tree-ssa-loop-manip.h (gimple_duplicate_loop_body_to_header_edge): Likewise. --- gcc/cfghooks.c | 27 ++++++++++++--------------- gcc/cfghooks.h | 13 ++++++------- gcc/cfgloopmanip.c | 9 ++++----- gcc/cfgloopmanip.h | 6 +++--- gcc/cfgrtl.c | 2 +- gcc/doc/loop.texi | 4 ++-- gcc/loop-unroll.c | 27 ++++++++++++--------------- gcc/tree-cfg.c | 2 +- gcc/tree-ssa-loop-ivcanon.c | 4 ++-- gcc/tree-ssa-loop-manip.c | 22 ++++++++++++---------- gcc/tree-ssa-loop-manip.h | 7 +++---- 11 files changed, 58 insertions(+), 65 deletions(-) diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 50b9b177639..23eb364bee6 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -1226,25 +1226,22 @@ lv_flush_pending_stmts (edge e) cfg_hooks->flush_pending_stmts (e); } -/* Loop versioning uses the duplicate_loop_to_header_edge to create +/* Loop versioning uses the duplicate_loop_body_to_header_edge to create a new version of the loop basic-blocks, the parameters here are - exactly the same as in duplicate_loop_to_header_edge or - tree_duplicate_loop_to_header_edge; while in tree-ssa there is + exactly the same as in duplicate_loop_body_to_header_edge or + tree_duplicate_loop_body_to_header_edge; while in tree-ssa there is additional work to maintain ssa information that's why there is - a need to call the tree_duplicate_loop_to_header_edge rather - than duplicate_loop_to_header_edge when we are in tree mode. */ + a need to call the tree_duplicate_loop_body_to_header_edge rather + than duplicate_loop_body_to_header_edge when we are in tree mode. */ bool -cfg_hook_duplicate_loop_to_header_edge (class loop *loop, edge e, - unsigned int ndupl, - sbitmap wont_exit, edge orig, - vec *to_remove, - int flags) +cfg_hook_duplicate_loop_body_to_header_edge (class loop *loop, edge e, + unsigned int ndupl, + sbitmap wont_exit, edge orig, + vec *to_remove, int flags) { - gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge); - return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e, - ndupl, wont_exit, - orig, to_remove, - flags); + gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_body_to_header_edge); + return cfg_hooks->cfg_hook_duplicate_loop_body_to_header_edge ( + loop, e, ndupl, wont_exit, orig, to_remove, flags); } /* Conditional jumps are represented differently in trees and RTL, diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h index 8645fe5b9e7..29aa2bf0636 100644 --- a/gcc/cfghooks.h +++ b/gcc/cfghooks.h @@ -166,7 +166,7 @@ struct cfg_hooks /* A hook for duplicating loop in CFG, currently this is used in loop versioning. */ - bool (*cfg_hook_duplicate_loop_to_header_edge) (class loop *, edge, + bool (*cfg_hook_duplicate_loop_body_to_header_edge) (class loop *, edge, unsigned, sbitmap, edge, vec *, int); @@ -250,12 +250,11 @@ extern bool block_ends_with_condjump_p (const_basic_block bb); extern int flow_call_edges_add (sbitmap); extern void execute_on_growing_pred (edge); extern void execute_on_shrinking_pred (edge); -extern bool cfg_hook_duplicate_loop_to_header_edge (class loop *loop, edge, - unsigned int ndupl, - sbitmap wont_exit, - edge orig, - vec *to_remove, - int flags); +extern bool +cfg_hook_duplicate_loop_body_to_header_edge (class loop *loop, edge, + unsigned int ndupl, + sbitmap wont_exit, edge orig, + vec *to_remove, int flags); extern void lv_flush_pending_stmts (edge); extern void extract_cond_bb_edges (basic_block, edge *, edge*); diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index 066fbddbcfe..455c3ef8db9 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -1059,10 +1059,9 @@ can_duplicate_loop_p (const class loop *loop) impossible. */ bool -duplicate_loop_to_header_edge (class loop *loop, edge e, - unsigned int ndupl, sbitmap wont_exit, - edge orig, vec *to_remove, - int flags) +duplicate_loop_body_to_header_edge (class loop *loop, edge e, + unsigned int ndupl, sbitmap wont_exit, + edge orig, vec *to_remove, int flags) { class loop *target, *aloop; class loop **orig_loops; @@ -1630,7 +1629,7 @@ clone_loop_to_header_edge (class loop *loop, void *cond_expr, first_head = entry->dest; /* 1) Duplicate loop on the entry edge. */ - if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1, + if (!cfg_hook_duplicate_loop_body_to_header_edge (loop, entry, 1, NULL, NULL, NULL, 0)) { entry->flags |= irred_flag; diff --git a/gcc/cfgloopmanip.h b/gcc/cfgloopmanip.h index eac09518702..42ba0689825 100644 --- a/gcc/cfgloopmanip.h +++ b/gcc/cfgloopmanip.h @@ -48,9 +48,9 @@ extern class loop * duplicate_loop (class loop *, class loop *, class loop * = NULL); extern void duplicate_subloops (class loop *, class loop *); extern bool can_duplicate_loop_p (const class loop *loop); -extern bool duplicate_loop_to_header_edge (class loop *, edge, - unsigned, sbitmap, edge, - vec *, int); +extern bool +duplicate_loop_body_to_header_edge (class loop *, edge, unsigned, sbitmap, edge, + vec *, int); extern bool mfb_keep_just (edge); basic_block create_preheader (class loop *, int); extern void create_preheaders (int); diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 4f3b1e8f3dc..e3a724bddb4 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -5344,7 +5344,7 @@ struct cfg_hooks cfg_layout_rtl_cfg_hooks = { rtl_flow_call_edges_add, NULL, /* execute_on_growing_pred */ NULL, /* execute_on_shrinking_pred */ - duplicate_loop_to_header_edge, /* duplicate loop for trees */ + duplicate_loop_body_to_header_edge, /* duplicate loop for trees */ rtl_lv_add_condition_to_bb, /* lv_add_condition_to_bb */ NULL, /* lv_adjust_loop_header_phi*/ rtl_extract_cond_bb_edges, /* extract_cond_bb_edges */ diff --git a/gcc/doc/loop.texi b/gcc/doc/loop.texi index 94eed6720b1..29a580066d6 100644 --- a/gcc/doc/loop.texi +++ b/gcc/doc/loop.texi @@ -249,8 +249,8 @@ are only reliable for the innermost loops: @item @code{create_iv}: Creates a new induction variable. Only works on GIMPLE@. @code{standard_iv_increment_position} can be used to find a suitable place for the iv increment. -@item @code{duplicate_loop_to_header_edge}, -@code{tree_duplicate_loop_to_header_edge}: These functions (on RTL and +@item @code{duplicate_loop_body_to_header_edge}, +@code{tree_duplicate_loop_body_to_header_edge}: These functions (on RTL and on GIMPLE) duplicate the body of the loop prescribed number of times on one of the edges entering loop header, thus performing either loop unrolling or loop peeling. @code{can_duplicate_loop_p} diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 2b31fafa3a3..f554ebb8450 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -520,14 +520,11 @@ unroll_loop_constant_iterations (class loop *loop) if (exit_mod) { opt_info_start_duplication (opt_info); - ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - exit_mod, - wont_exit, desc->out_edge, - &remove_edges, - DLTHE_FLAG_UPDATE_FREQ - | (opt_info && exit_mod > 1 - ? DLTHE_RECORD_COPY_NUMBER - : 0)); + ok = duplicate_loop_body_to_header_edge ( + loop, loop_preheader_edge (loop), exit_mod, wont_exit, + desc->out_edge, &remove_edges, + DLTHE_FLAG_UPDATE_FREQ + | (opt_info && exit_mod > 1 ? DLTHE_RECORD_COPY_NUMBER : 0)); gcc_assert (ok); if (opt_info && exit_mod > 1) @@ -569,7 +566,7 @@ unroll_loop_constant_iterations (class loop *loop) bitmap_clear_bit (wont_exit, 1); opt_info_start_duplication (opt_info); - ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_preheader_edge (loop), exit_mod + 1, wont_exit, desc->out_edge, &remove_edges, @@ -606,7 +603,7 @@ unroll_loop_constant_iterations (class loop *loop) /* Now unroll the loop. */ opt_info_start_duplication (opt_info); - ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_latch_edge (loop), max_unroll, wont_exit, desc->out_edge, &remove_edges, @@ -975,7 +972,7 @@ unroll_loop_runtime_iterations (class loop *loop) if (!desc->noloop_assumptions) bitmap_set_bit (wont_exit, 1); ezc_swtch = loop_preheader_edge (loop)->src; - ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_preheader_edge (loop), 1, wont_exit, desc->out_edge, &remove_edges, DLTHE_FLAG_UPDATE_FREQ); @@ -997,7 +994,7 @@ unroll_loop_runtime_iterations (class loop *loop) bitmap_clear (wont_exit); if (i != n_peel - 1 || !last_may_exit) bitmap_set_bit (wont_exit, 1); - ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_preheader_edge (loop), 1, wont_exit, desc->out_edge, &remove_edges, DLTHE_FLAG_UPDATE_FREQ); @@ -1061,7 +1058,7 @@ unroll_loop_runtime_iterations (class loop *loop) bitmap_clear_bit (wont_exit, may_exit_copy); opt_info_start_duplication (opt_info); - ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_latch_edge (loop), max_unroll, wont_exit, desc->out_edge, &remove_edges, @@ -1255,7 +1252,7 @@ unroll_loop_stupid (class loop *loop) bitmap_clear (wont_exit); opt_info_start_duplication (opt_info); - ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + ok = duplicate_loop_body_to_header_edge (loop, loop_latch_edge (loop), nunroll, wont_exit, NULL, NULL, DLTHE_FLAG_UPDATE_FREQ @@ -2019,7 +2016,7 @@ apply_opt_in_copies (struct opt_info *opt_info, orig_bb = get_bb_original (bb); /* bb->aux holds position in copy sequence initialized by - duplicate_loop_to_header_edge. */ + duplicate_loop_body_to_header_edge. */ delta = determine_split_iv_delta ((size_t)bb->aux, n_copies, unrolling); bb->aux = 0; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 9883eaaa9bf..d0177cb1c07 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -9072,7 +9072,7 @@ struct cfg_hooks gimple_cfg_hooks = { gimple_flow_call_edges_add, /* flow_call_edges_add */ gimple_execute_on_growing_pred, /* execute_on_growing_pred */ gimple_execute_on_shrinking_pred, /* execute_on_shrinking_pred */ - gimple_duplicate_loop_to_header_edge, /* duplicate loop for trees */ + gimple_duplicate_loop_body_to_header_edge, /* duplicate loop for trees */ gimple_lv_add_condition_to_bb, /* lv_add_condition_to_bb */ gimple_lv_adjust_loop_header_phi, /* lv_adjust_loop_header_phi*/ extract_true_false_edges_from_block, /* extract_cond_bb_edges */ diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 8d8791f837e..a9107ef5ffb 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -903,7 +903,7 @@ try_unroll_loop_completely (class loop *loop, if (may_be_zero) bitmap_clear_bit (wont_exit, 1); - if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + if (!gimple_duplicate_loop_body_to_header_edge (loop, loop_preheader_edge (loop), n_unroll, wont_exit, exit, &edges_to_remove, DLTHE_FLAG_UPDATE_FREQ @@ -1094,7 +1094,7 @@ try_peel_loop (class loop *loop, } if (may_be_zero) bitmap_clear_bit (wont_exit, 1); - if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + if (!gimple_duplicate_loop_body_to_header_edge (loop, loop_preheader_edge (loop), npeel, wont_exit, exit, &edges_to_remove, DLTHE_FLAG_UPDATE_FREQ)) diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index 350e25bb8d2..b60da4fb084 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -911,7 +911,7 @@ copy_phi_node_args (unsigned first_new_block) } -/* The same as cfgloopmanip.c:duplicate_loop_to_header_edge, but also +/* The same as cfgloopmanip.c:duplicate_loop_body_to_header_edge, but also updates the PHI nodes at start of the copied region. In order to achieve this, only loops whose exits all lead to the same location are handled. @@ -921,10 +921,10 @@ copy_phi_node_args (unsigned first_new_block) after the loop has been duplicated. */ bool -gimple_duplicate_loop_to_header_edge (class loop *loop, edge e, - unsigned int ndupl, sbitmap wont_exit, - edge orig, vec *to_remove, - int flags) +gimple_duplicate_loop_body_to_header_edge (class loop *loop, edge e, + unsigned int ndupl, + sbitmap wont_exit, edge orig, + vec *to_remove, int flags) { unsigned first_new_block; @@ -934,8 +934,8 @@ gimple_duplicate_loop_to_header_edge (class loop *loop, edge e, return false; first_new_block = last_basic_block_for_fn (cfun); - if (!duplicate_loop_to_header_edge (loop, e, ndupl, wont_exit, - orig, to_remove, flags)) + if (!duplicate_loop_body_to_header_edge (loop, e, ndupl, wont_exit, orig, + to_remove, flags)) return false; /* Readd the removed phi args for e. */ @@ -1390,9 +1390,11 @@ tree_transform_and_unroll_loop (class loop *loop, unsigned factor, bitmap_clear_bit (wont_exit, factor - 1); auto_vec to_remove; - bool ok = gimple_duplicate_loop_to_header_edge - (loop, loop_latch_edge (loop), factor - 1, - wont_exit, new_exit, &to_remove, DLTHE_FLAG_UPDATE_FREQ); + bool ok + = gimple_duplicate_loop_body_to_header_edge (loop, loop_latch_edge (loop), + factor - 1, wont_exit, + new_exit, &to_remove, + DLTHE_FLAG_UPDATE_FREQ); gcc_assert (ok); for (edge e : to_remove) diff --git a/gcc/tree-ssa-loop-manip.h b/gcc/tree-ssa-loop-manip.h index 86fc118b6be..792c366701b 100644 --- a/gcc/tree-ssa-loop-manip.h +++ b/gcc/tree-ssa-loop-manip.h @@ -42,10 +42,9 @@ extern basic_block ip_end_pos (class loop *); extern basic_block ip_normal_pos (class loop *); extern void standard_iv_increment_position (class loop *, gimple_stmt_iterator *, bool *); -extern bool gimple_duplicate_loop_to_header_edge (class loop *, edge, - unsigned int, sbitmap, - edge, vec *, - int); +extern bool +gimple_duplicate_loop_body_to_header_edge (class loop *, edge, unsigned int, + sbitmap, edge, vec *, int); extern bool can_unroll_loop_p (class loop *loop, unsigned factor, class tree_niter_desc *niter); extern gcov_type niter_for_unrolled_loop (class loop *, unsigned);