GCC Middle and Back End API Reference
|
Go to the source code of this file.
Functions | |
tree | number_of_latch_executions (struct loop *) |
tree | number_of_exit_cond_executions (struct loop *) |
gimple | get_loop_exit_condition (const struct loop *) |
void | scev_initialize (void) |
bool | scev_initialized_p (void) |
void | scev_reset (void) |
void | scev_reset_htab (void) |
void | scev_finalize (void) |
tree | analyze_scalar_evolution (struct loop *, tree) |
tree | instantiate_scev (basic_block, struct loop *, tree) |
tree | resolve_mixers (struct loop *, tree) |
void | gather_stats_on_scev_database (void) |
unsigned int | scev_const_prop (void) |
bool | expression_expensive_p (tree) |
bool | simple_iv (struct loop *, struct loop *, tree, struct affine_iv_d *, bool) |
tree | compute_overall_effect_of_inner_loop (struct loop *, tree) |
static basic_block | block_before_loop () |
static tree | instantiate_parameters () |
static struct loop * | get_chrec_loop () |
|
inlinestatic |
Returns the basic block preceding LOOP or ENTRY_BLOCK_PTR when the loop is function's body.
Referenced by compute_scalar_evolution_in_loop().
void gather_stats_on_scev_database | ( | void | ) |
Classify the chrecs of the whole database.
|
staticread |
Returns the loop of the polynomial chrec CHREC.
Referenced by analyze_ziv_subscript(), chrec_contains_undetermined(), chrec_replace_initial_condition(), hide_evolution_in_other_loops_than_loop(), initialize_matrix_A(), lambda_vector_equal(), and loop_phi_node_p().
|
inlinestatic |
Analyze all the parameters of the chrec that were left under a symbolic form. LOOP is the loop in which symbolic names have to be analyzed and instantiated.
Referenced by compute_overall_effect_of_inner_loop(), and extract_range_from_comparison().
tree instantiate_scev | ( | basic_block | instantiate_below, |
struct loop * | evolution_loop, | ||
tree | chrec | ||
) |
Analyze all the parameters of the chrec that were left under a symbolic form. INSTANTIATE_BELOW is the basic block that stops the recursive instantiation of parameters: a parameter is a variable that is defined in a basic block that dominates INSTANTIATE_BELOW or a function parameter.
Referenced by dr_analyze_indices(), and move_sese_in_condition().
Scalar evolution detector. Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Sebastian Pop s.pop @lap oste. net
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/.
unsigned int scev_const_prop | ( | void | ) |
Replace ssa names for that scev can prove they are constant by the appropriate constants. Also perform final value replacement in loops, in case the replacement expressions are cheap.
We only consider SSA names defined by phi nodes; rest is left to the ordinary constant propagation pass.
Replace the uses of the name.
Remove the ssa names that were replaced by constants. We do not remove them directly in the previous cycle, since this invalidates scev cache. Now the regular final value replacement.
If we do not know exact number of iterations of the loop, we cannot replace the final value.
Ensure that it is possible to insert new statements somewhere.
Moving the computation from the loop may prolong life range of some ssa names, which may cause problems if they appear on abnormal edges.
Do not emit expensive expressions. The rationale is that when someone writes a code like while (n > 45) n -= 45; he probably knows that n is not large, and does not want it to be turned into n %= 45.
Eliminate the PHI node and replace it by a computation outside the loop.
void scev_finalize | ( | void | ) |
Finalize the scalar evolution analysis.
References gsi_next(), gsi_stmt(), INTEGRAL_TYPE_P, PHI_ARG_DEF_FROM_EDGE, PHI_RESULT, POINTER_TYPE_P, TREE_TYPE, and virtual_operand_p().
Referenced by analyze_function().
void scev_initialize | ( | void | ) |
Initialize the analysis of scalar evolutions for LOOPS.
References integer_pow2p(), and TREE_OPERAND.
Referenced by analyze_function().
bool scev_initialized_p | ( | void | ) |
Return true if SCEV is initialized.
void scev_reset | ( | void | ) |
Cleans up the information cached by the scalar evolutions analysis in the hash table and in the loop->nb_iterations.
References analyze_scalar_evolution(), BITMAP_ALLOC, gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), INTEGRAL_TYPE_P, is_gimple_min_invariant(), basic_block_def::loop_father, may_propagate_copy(), NULL, PHI_RESULT, POINTER_TYPE_P, replace_uses_by(), resolve_mixers(), TREE_TYPE, and virtual_operand_p().
Referenced by vect_update_ivs_after_vectorizer().
void scev_reset_htab | ( | void | ) |
Cleans up the information cached by the scalar evolutions analysis in the hash table.
References type().
Referenced by gather_chrec_stats().
bool simple_iv | ( | struct loop * | wrto_loop, |
struct loop * | use_loop, | ||
tree | op, | ||
affine_iv * | iv, | ||
bool | allow_nonconstant_step | ||
) |
Checks whether use of OP in USE_LOOP behaves as a simple affine iv with respect to WRTO_LOOP and returns its base and step in IV if possible (see analyze_scalar_evolution_in_loop for more details on USE_LOOP and WRTO_LOOP). If ALLOW_NONCONSTANT_STEP is true, we want step to be invariant in LOOP. Otherwise we require it to be an integer constant.
IV->no_overflow is set to true if we are sure the iv cannot overflow (e.g. because it is computed in signed arithmetics). Consequently, adding an induction variable
for (i = IV->base; ; i += IV->step)
is only safe if IV->no_overflow is false, or TYPE_OVERFLOW_UNDEFINED is false for the type of the induction variable, or you can prove that i does not wrap by some other argument. Otherwise, this might introduce undefined behavior, and
for (i = iv->base; ; i = (type) ((unsigned type) i + (unsigned type) iv->step))
must be used instead.
Referenced by create_expression_by_pieces(), release_mem_refs(), and simplify_using_outer_evolutions().