GCC Middle and Back End API Reference
|
Functions | |
static struct loop * | tree_unswitch_loop (struct loop *, basic_block, tree) |
static bool | tree_unswitch_single_loop (struct loop *, int) |
static tree | tree_may_unswitch_on (basic_block, struct loop *) |
unsigned int | tree_ssa_unswitch_loops () |
static tree | tree_may_unswitch_on () |
static tree | simplify_using_entry_checks () |
static bool | tree_unswitch_single_loop () |
|
static |
Simplifies COND using checks in front of the entry of the LOOP. Just very simplish (sufficient to prevent us from duplicating loop in unswitching unnecessarily).
References edge_def::flags, gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), last_stmt(), loop_preheader_edge(), operand_equal_p(), single_pred_edge(), single_pred_p(), and edge_def::src.
Referenced by tree_unswitch_single_loop().
|
static |
Referenced by tree_unswitch_single_loop().
|
static |
Checks whether we can unswitch LOOP on condition at end of BB -- one of its basic blocks (for what it means see comments below).
References flow_bb_inside_loop_p(), gimple_bb(), gimple_cond_code(), gimple_cond_false_p(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_true_p(), and last_stmt().
unsigned int tree_ssa_unswitch_loops | ( | void | ) |
Main entry point. Perform loop unswitching on all suitable loops.
References changed, dump_file, dump_flags, eni_size_weights, estimated_loop_iterations_int(), HOST_WIDE_INT, LI_ONLY_INNERMOST, loop::num, optimize_loop_for_size_p(), tree_num_loop_insns(), and tree_unswitch_single_loop().
Referenced by tree_ssa_loop_unswitch().
|
staticread |
@verbatim Loop unswitching.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
This file implements the loop unswitching, i.e. transformation of loops like while (A) { if (inv) B; X; if (!inv) C; } where inv is the loop invariant, into if (inv) { while (A) { B; X; } } else { while (A) { X; C; } } Inv is considered invariant iff the values it compares are both invariant; tree-ssa-loop-im.c ensures that all the suitable conditions are in this shape.
Unswitch a LOOP w.r. to given basic block UNSWITCH_ON. We only support unswitching of innermost loops. COND is the condition determining which loop is entered -- the new loop is entered if COND is true. Returns NULL if impossible, new loop otherwise.
References extract_true_false_edges_from_block(), flow_bb_inside_loop_p(), loop::inner, loop_version(), edge_def::probability, basic_block_def::succs, and unshare_expr().
Referenced by tree_unswitch_single_loop().
|
static |
Referenced by tree_ssa_unswitch_loops(), and tree_unswitch_single_loop().
|
static |
Unswitch single LOOP. NUM is number of unswitchings done; we do not allow it to grow too much, it is too easy to create example on that the code would grow exponentially.
References changed, edge_def::dest, dump_file, dump_flags, edge_def::flags, basic_block_def::flags, free(), free_original_copy_tables(), get_loop_body(), gimple_cond_false_p(), gimple_cond_set_condition_from_tree(), gimple_cond_true_p(), initialize_original_copy_tables(), integer_nonzerop(), integer_zerop(), last_stmt(), basic_block_def::loop_father, loop::num_nodes, simplify_using_entry_checks(), basic_block_def::succs, tree_may_unswitch_on(), tree_unswitch_loop(), tree_unswitch_single_loop(), update_ssa(), update_stmt(), and worklist.