GCC Middle and Back End API Reference
|
Typedefs | |
typedef int | complex_lattice_t |
Enumerations | |
enum | { UNINITIALIZED = 0, ONLY_REAL = 1, ONLY_IMAG = 2, VARYING = 3 } |
Variables | |
static vec< complex_lattice_t > | complex_lattice_values |
static int_tree_htab_type | complex_variable_components |
static vec< tree > | complex_ssa_name_components |
typedef int complex_lattice_t |
The type complex_lattice_t holds combinations of the above constants.
anonymous enum |
@verbatim Lower complex number operations to scalar operations.
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/.
For each complex ssa name, a lattice value. We're interested in finding out whether a complex number is degenerate in some way, having only real or only complex parts.
|
static |
Evaluate a PHI node against the complex lattice defined above.
References find_lattice_value(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), SSA_PROP_INTERESTING, SSA_PROP_NOT_INTERESTING, SSA_PROP_VARYING, UNINITIALIZED, and VARYING.
Referenced by tree_lower_complex().
|
static |
Evaluate statement STMT against the complex lattice defined above.
References find_lattice_value(), find_lattice_value_parts(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_expr_code(), gimple_get_lhs(), ONLY_REAL, SSA_PROP_INTERESTING, SSA_PROP_NOT_INTERESTING, SSA_PROP_VARYING, UNINITIALIZED, and VARYING.
Referenced by tree_lower_complex().
|
static |
Create one backing variable for a complex component of ORIG.
References create_tmp_var(), and get_identifier().
Referenced by get_component_var().
|
static |
Insert the pair UID, TO into the complex_variable_components hashtable.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), int_tree_map::to, and int_tree_map::uid.
Referenced by get_component_var().
|
static |
Lookup UID in the complex_variable_components hashtable and return the associated tree.
References hash_table< Descriptor, Allocator >::find_with_hash(), int_tree_map::to, and int_tree_map::uid.
Referenced by get_component_var().
|
static |
Expand complex addition to scalars: a + b = (ar + br) + i(ai + bi) a - b = (ar - br) + i(ai + bi)
References gimplify_build2(), ONLY_IMAG, ONLY_REAL, update_complex_assignment(), and VARYING.
Referenced by expand_complex_operations_1().
|
static |
Expand inline asm that sets some complex SSA_NAMEs.
References gimple_asm_noutputs(), gimple_asm_output_op(), GSI_CONTINUE_LINKING, gsi_insert_seq_after(), gsi_stmt(), and set_component_ssa_name().
Referenced by expand_complex_operations_1().
|
static |
Expand complex comparison (EQ or NE only).
References gimple_assign_lhs(), gimple_assign_set_rhs_from_tree(), gimple_cond_set_code(), gimple_cond_set_lhs(), gimple_cond_set_rhs(), gimple_return_retval(), gimple_return_set_retval(), gimplify_build2(), gsi_stmt(), type(), and update_stmt().
Referenced by expand_complex_operations_1().
|
static |
Expand complex conjugate to scalars: ~a = (ar) + i(-ai)
References gimplify_build1(), and update_complex_assignment().
Referenced by expand_complex_operations_1().
|
static |
Keep this algorithm in sync with fold-const.c:const_binop(). Expand complex division to scalars, straightforward algorithm. a / b = ((ar*br + ai*bi)/t) + i((ai*br - ar*bi)/t) t = br*br + bi*bi
References gimplify_build2(), and update_complex_assignment().
Referenced by expand_complex_division().
|
static |
Keep this algorithm in sync with fold-const.c:const_binop(). Expand complex division to scalars, modified algorithm to minimize overflow with wide input ranges.
References add_bb_to_loop(), CDI_DOMINATORS, cfun, create_empty_bb(), create_tmp_reg(), create_tmp_var(), edge_def::dest, dom_info_available_p(), edge_def::flags, gimple_assign_set_lhs(), gimple_build_cond_from_tree(), gimple_build_nop(), gimple_in_ssa_p(), gimple_location(), gimplify_build1(), gimplify_build2(), gsi_bb(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_remove(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), integer_nonzerop(), integer_zerop(), basic_block_def::loop_father, make_edge(), make_ssa_name(), redirect_edge_succ(), set_immediate_dominator(), split_block(), edge_def::src, tr(), and update_complex_assignment().
Referenced by expand_complex_division().
|
static |
Expand complex division to scalars.
References expand_complex_div_straight(), expand_complex_div_wide(), expand_complex_libcall(), gimplify_build1(), gimplify_build2(), ONLY_IMAG, ONLY_REAL, update_complex_assignment(), and VARYING.
Referenced by expand_complex_operations_1().
|
static |
Expand a complex multiplication or division to a libcall to the c99 compliant routines.
References BUILT_IN_COMPLEX_DIV_MIN, BUILT_IN_COMPLEX_MUL_MIN, builtin_decl_explicit(), cfun, gimple_assign_lhs(), gimple_build_call(), gimple_call_set_lhs(), gimple_in_ssa_p(), gimple_purge_dead_eh_edges(), gsi_bb(), gsi_replace(), gsi_stmt(), maybe_clean_or_replace_eh_stmt(), type(), update_complex_components(), and update_stmt().
Referenced by expand_complex_division(), and expand_complex_multiplication().
|
static |
Expand a complex move to scalars.
References extract_component(), find_fallthru_edge(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_set_lhs(), gimple_assign_set_rhs1(), gimple_call_lhs(), gimple_has_side_effects(), gimple_num_ops(), gimple_return_set_retval(), gsi_bb(), gsi_insert_before(), GSI_SAME_STMT, gsi_stmt(), is_ctrl_altering_stmt(), is_gimple_assign(), is_gimple_call(), basic_block_def::succs, unshare_expr(), update_complex_assignment(), update_complex_components(), update_complex_components_on_edge(), and update_stmt().
Referenced by expand_complex_operations_1().
|
static |
Expand complex multiplication to scalars: a * b = (ar*br - ai*bi) + i(ar*bi + br*ai)
References dconst1, expand_complex_libcall(), gimplify_build1(), gimplify_build2(), ONLY_IMAG, ONLY_REAL, update_complex_assignment(), and VARYING.
Referenced by expand_complex_operations_1().
|
static |
Expand complex negation to scalars: -a = (-ar) + i(-ai)
References gimplify_build1(), and update_complex_assignment().
Referenced by expand_complex_operations_1().
|
static |
Process one statement. If we identify a complex operation, expand it.
References cfun, expand_complex_addition(), expand_complex_asm(), expand_complex_comparison(), expand_complex_conjugate(), expand_complex_division(), expand_complex_move(), expand_complex_multiplication(), expand_complex_negation(), extract_component(), find_lattice_value(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_set_rhs_from_tree(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_expr_code(), gimple_get_lhs(), gimple_in_ssa_p(), gimple_num_ops(), gimple_op(), gsi_stmt(), is_gimple_assign(), tcc_unary, type(), UNINITIALIZED, update_stmt(), and VARYING.
Referenced by tree_lower_complex().
|
static |
Extract the real or imaginary part of a complex variable or constant. Make sure that it's a proper gimple_val and gimplify it if not. Emit any new code before gsi.
References force_gimple_operand_gsi(), get_component_ssa_name(), GSI_SAME_STMT, and unshare_expr().
Referenced by expand_complex_move(), expand_complex_operations_1(), and update_phi_components().
|
static |
Compute a lattice value from gimple_val T.
References find_lattice_value_parts().
Referenced by complex_visit_phi(), complex_visit_stmt(), expand_complex_operations_1(), get_component_ssa_name(), and set_component_ssa_name().
|
static |
Compute a lattice value from the components of a complex type REAL and IMAG.
References ONLY_IMAG, ONLY_REAL, some_nonzerop(), and UNINITIALIZED.
Referenced by complex_visit_stmt(), and find_lattice_value().
|
static |
References cfun, and function::curr_properties.
|
static |
Retrieve a value for a complex component of SSA_NAME.
References build_int_cst(), build_real(), cfun, dconst0, find_lattice_value(), get_component_var(), make_ssa_name(), ONLY_IMAG, ONLY_REAL, and set_ssa_default_def().
Referenced by extract_component(), set_component_ssa_name(), and update_phi_components().
|
static |
Retrieve a value for a complex component of VAR.
References create_one_component_var(), cvc_insert(), and cvc_lookup().
Referenced by get_component_ssa_name(), and set_component_ssa_name().
|
static |
Initialize simulation state for each statement. Return false if we found no statements we want to simulate, and thus there's nothing for the entire pass to do.
References gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_call_lhs(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_expr_code(), gimple_num_ops(), gimple_phi_result(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_complex_reg(), prop_set_simulate_again(), ssa_undefined_value_p(), and stmt_ends_bb_p().
Referenced by tree_lower_complex().
|
static |
Mark the incoming parameters to the function as VARYING.
References cfun, function::decl, is_complex_reg(), ssa_default_def(), and VARYING.
Referenced by tree_lower_complex().
|
static |
Determine if LHS is something for which we're interested in seeing simulation results.
References is_gimple_reg().
Referenced by init_dont_simulate_again(), init_parameter_lattice_values(), and update_phi_components().
gimple_opt_pass* make_pass_lower_complex | ( | ) |
gimple_opt_pass* make_pass_lower_complex_O0 | ( | ) |
|
static |
Set a value for a complex component of SSA_NAME, return a gimple_seq of stuff that needs doing.
References comp, find_lattice_value(), force_gimple_operand(), get_component_ssa_name(), get_component_var(), gimple_seq_add_stmt(), is_gimple_min_invariant(), last, ONLY_IMAG, ONLY_REAL, and replace_ssa_name_symbol().
Referenced by expand_complex_asm(), update_complex_components(), and update_complex_components_on_edge().
|
static |
Return true if T is not a zero constant. In the case of real values, we're only interested in +0.0.
References dconst0, fixed_zerop(), and integer_zerop().
Referenced by find_lattice_value_parts().
|
static |
Entry point for complex operation lowering during optimization.
References complex_visit_phi(), complex_visit_stmt(), hash_table< Descriptor, Allocator >::create(), hash_table< Descriptor, Allocator >::dispose(), expand_complex_operations_1(), gsi_commit_edge_inserts(), gsi_end_p(), gsi_next(), gsi_start_bb(), basic_block_def::index, init_dont_simulate_again(), init_parameter_lattice_values(), ssa_propagate(), update_parameter_components(), and update_phi_components().
|
static |
Update an assignment to a complex variable in place.
References cfun, gimple_assign_set_rhs_with_ops(), gimple_in_ssa_p(), gimple_purge_dead_eh_edges(), gsi_stmt(), maybe_clean_eh_stmt(), update_complex_components(), and update_stmt().
Referenced by expand_complex_addition(), expand_complex_conjugate(), expand_complex_div_straight(), expand_complex_div_wide(), expand_complex_division(), expand_complex_move(), expand_complex_multiplication(), and expand_complex_negation().
|
static |
Update the complex components of the ssa name on the lhs of STMT.
References gimple_get_lhs(), GSI_CONTINUE_LINKING, gsi_insert_seq_after(), and set_component_ssa_name().
Referenced by expand_complex_libcall(), expand_complex_move(), and update_complex_assignment().
|
static |
References gsi_insert_seq_on_edge(), and set_component_ssa_name().
Referenced by expand_complex_move(), and update_parameter_components().
|
static |
Generate code at the entry point of the function to initialize the component variables for a complex parameter.
References cfun, function::decl, is_gimple_reg(), single_succ_edge(), ssa_default_def(), and update_complex_components_on_edge().
Referenced by tree_lower_complex().
|
static |
Generate code to set the component variables of a complex variable to match the PHI statements in block BB.
References comp, create_phi_node(), extract_component(), get_component_ssa_name(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), and is_complex_reg().
Referenced by tree_lower_complex().
|
static |
For each complex SSA_NAME, a pair of ssa names for the components.
|
static |
For each complex variable, a pair of variables for the components exists in the hashtable.