diff options
author | Richard Henderson <rth@redhat.com> | 2005-06-09 00:43:40 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-06-09 00:43:40 -0700 |
commit | e41d82f5d776d2d4ddf1a4346e63213da455edad (patch) | |
tree | 003bf598fc6be666e758e157426518abcb2fef62 /gcc/tree-gimple.c | |
parent | 31920d83c2940d00b1c91d820016c6c67523cf60 (diff) | |
download | gcc-e41d82f5d776d2d4ddf1a4346e63213da455edad.zip gcc-e41d82f5d776d2d4ddf1a4346e63213da455edad.tar.gz gcc-e41d82f5d776d2d4ddf1a4346e63213da455edad.tar.bz2 |
re PR tree-optimization/20610 (Real by complex multiplications perform unnecessary operations)
PR tree-opt/20610
* tree.h (DECL_COMPLEX_GIMPLE_REG_P): New.
(struct tree_decl): Add gimple_reg_flag.
* integrate.c (copy_decl_for_inlining): Copy it.
* gimplify.c (internal_get_tmp_var): Set it.
(gimplify_bind_expr): Likewise.
(gimplify_function_tree): Likewise.
(gimplify_modify_expr_complex_part): New.
(gimplify_modify_expr): Use it.
* tree-gimple.c (is_gimple_reg_type): Allow complex.
(is_gimple_reg): Allow complex with DECL_COMPLEX_GIMPLE_REG_P set.
* tree-complex.c (complex_lattice_t): New.
(complex_lattice_values, complex_variable_components): New.
(some_nonzerop, find_lattice_value, is_complex_reg,
init_parameter_lattice_values, init_dont_simulate_again,
complex_visit_stmt, complex_visit_phi, create_components,
update_complex_components, update_parameter_components,
update_phi_components, update_all_vops, expand_complex_move): New.
(extract_component): Handle INDIRECT_REF, COMPONENT_REF, ARRAY_REF,
SSA_NAME.
(update_complex_assignment): Use update_complex_components;
handle updates of return_expr properly.
(expand_complex_addition): Use complex lattice values.
(expand_complex_multiplication): Likewise.
(expand_complex_division): Likewise.
(expand_complex_libcall): Use update_complex_components.
(expand_complex_comparison): Use update_stmt.
(expand_complex_operations_1): Use expand_complex_move, retrieve
lattice values.
(tree_lower_complex): Compute lattice values.
(tree_lower_complex_O0): Duplicate from tree_lower_complex.
(pass_lower_complex_O0): Rename from pass_lower_complex.
(pass_lower_complex, gate_no_optimization): New.
* tree-optimize.c (init_tree_optimization_passes): Update for
complex pass changes.
* tree-pass.h (pass_lower_complex_O0): Declare.
From-SVN: r100793
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r-- | gcc/tree-gimple.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index e723b47..3bf773b 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -260,12 +260,10 @@ is_gimple_id (tree t) bool is_gimple_reg_type (tree type) { - return (!AGGREGATE_TYPE_P (type) - && TREE_CODE (type) != COMPLEX_TYPE); + return !AGGREGATE_TYPE_P (type); } - -/* Return true if T is a scalar register variable. */ +/* Return true if T is a non-aggregate register variable. */ bool is_gimple_reg (tree t) @@ -275,6 +273,7 @@ is_gimple_reg (tree t) if (!is_gimple_variable (t)) return false; + if (!is_gimple_reg_type (TREE_TYPE (t))) return false; @@ -301,6 +300,11 @@ is_gimple_reg (tree t) if (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t)) return false; + /* Complex values must have been put into ssa form. That is, no + assignments to the individual components. */ + if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE) + return DECL_COMPLEX_GIMPLE_REG_P (t); + return true; } |