GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | aff_comb_elt |
struct | affine_tree_combination |
Macros | |
#define | MAX_AFF_ELTS 8 |
Typedefs | |
typedef struct affine_tree_combination | aff_tree |
#define MAX_AFF_ELTS 8 |
Operations with affine combinations of trees. Copyright (C) 2005-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/. Affine combination of trees. We keep track of at most MAX_AFF_ELTS elements to make things simpler; this is sufficient in most cases.
Referenced by aff_combination_add_elt().
typedef struct affine_tree_combination aff_tree |
bool aff_comb_cannot_overlap_p | ( | aff_tree * | , |
double_int | , | ||
double_int | |||
) |
void aff_combination_add_elt | ( | aff_tree * | , |
tree | , | ||
double_int | |||
) |
void aff_combination_const | ( | aff_tree * | , |
tree | , | ||
double_int | |||
) |
bool aff_combination_constant_multiple_p | ( | aff_tree * | val, |
aff_tree * | div, | ||
double_int * | mult | ||
) |
Returns true if VAL = X * DIV for some constant X. If this is the case, X is stored to MULT.
References aff_comb_elt::coef, dump_double_int(), affine_tree_combination::elts, affine_tree_combination::n, affine_tree_combination::offset, POINTER_TYPE_P, print_generic_expr(), affine_tree_combination::rest, TDF_MEMSYMS, TDF_VOPS, affine_tree_combination::type, TYPE_UNSIGNED, and aff_comb_elt::val.
void aff_combination_expand | ( | aff_tree * | comb, |
struct pointer_map_t ** | cache | ||
) |
Expands SSA names in COMB recursively. CACHE is used to cache the results.
Look through some conversions.
We do not know whether the reference retains its value at the place where the expansion is used.
In principle this is a generally valid folding, but it is not unconditionally an optimization, so do it here and not in fold_unary.
Convert (T1)(X *+- CST) into (T1)X *+- (T1)CST if T1 is wider than the type of X and overflow for the type of X is undefined.
Since we follow the definitions in the SSA form, we should not enter a cycle unless we pass through a phi node.
Accumulate the new terms to TO_ADD, so that we do not modify COMB while traversing it; include the term -coef * E, to remove it from COMB.
void aff_combination_remove_elt | ( | aff_tree * | , |
unsigned | |||
) |
void aff_combination_scale | ( | aff_tree * | , |
double_int | |||
) |
void debug_aff | ( | aff_tree * | ) |
Debugging functions.
double_int double_int_ext_for_comb | ( | double_int | , |
aff_tree * | |||
) |
void free_affine_expand_cache | ( | struct pointer_map_t ** | ) |
void get_inner_reference_aff | ( | tree | , |
aff_tree * | , | ||
double_int * | |||
) |
void tree_to_aff_combination_expand | ( | tree | expr, |
tree | type, | ||
aff_tree * | comb, | ||
struct pointer_map_t ** | cache | ||
) |
Similar to tree_to_aff_combination, but follows SSA name definitions and expands them recursively. CACHE is used to cache the expansions of the ssa names, to avoid exponential time complexity for cases like
a1 = a0 + a0; a2 = a1 + a1; a3 = a2 + a2; ...
Referenced by merge_comps().
void unshare_aff_combination | ( | aff_tree * | ) |