diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2004-07-22 08:20:40 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2004-07-22 08:20:40 +0000 |
commit | 26277d41791a5f1817fbd3412ddb06f6efc961b9 (patch) | |
tree | 4646f9e5e0b2387d4bcc7fc94aff9d320ae0030d /gcc/tree-cfg.c | |
parent | 727a31fab813e31263cc0ee9f56940ee6d95782f (diff) | |
download | gcc-26277d41791a5f1817fbd3412ddb06f6efc961b9.zip gcc-26277d41791a5f1817fbd3412ddb06f6efc961b9.tar.gz gcc-26277d41791a5f1817fbd3412ddb06f6efc961b9.tar.bz2 |
tree-cfg.c (gimplify_val): Move from tree-complex.c.
2004-07-22 Paolo Bonzini <bonzini@gnu.org>
* tree-cfg.c (gimplify_val): Move from tree-complex.c.
(gimplify_build1): Move from tree-complex.c do_unop.
(gimplify_build2): Move from tree-complex.c do_binop.
(gimplify_build3): New.
* tree-complex.c (gimplify_val, do_unop, do_binop): Remove.
Adjust throughout to call the functions above.
* tree-flow.h: Declare the functions above.
* tree-nested.c (gimplify_val): Rename to...
(tsi_gimplify_val): ... this.
* Makefile.in (tree_complex.o): Update dependencies.
(stor-layout.o): Depend on regs.h.
* c-common.c (handle_vector_size_attribute): Update for
vector types without corresponding vector modes.
* expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if
a corresponding vector mode is not available.
* print-tree.c (print_node): Print nunits for vector types
* regclass.c (have_regs_of_mode): New.
(init_reg_sets_1): Initialize it and use it instead
of allocatable_regs_of_mode.
* regs.h (have_regs_of_mode): Declare it.
* stor-layout.c (layout_type): Pick a mode for vector types.
* tree-complex.c (build_word_mode_vector_type, tree_vec_extract,
build_replicated_const, do_unop, do_binop, do_plus_minus,
do_negate, expand_vector_piecewise, expand_vector_parallel,
expand_vector_addition, expand_vector_operations_1,
expand_vector_operations, tree_lower_operations,
pass_lower_vector_ssa, pass_pre_expand): New.
(expand_complex_operations, pass_lower_complex): Remove.
* tree-optimize.c (init_tree_optimization_passes): Adjust
pass ordering for changes in tree-complex.c.
* tree-pass.h: Declare new passes.
* tree.c (finish_vector_type): Remove.
(make_vector_type): New.
(build_vector_type_for_mode, build_vector_type): Rewritten.
* tree.def (VECTOR_TYPE): Document where the number of
subparts is stored.
* tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field.
(make_vector): Remove declaration.
From-SVN: r85039
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index c80dcf1..1c04e52 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4793,6 +4793,79 @@ struct tree_opt_pass pass_split_crit_edges = 0, /* todo_flags_start */ TODO_dump_func, /* todo_flags_finish */ }; + + +/* Return EXP if it is a valid GIMPLE rvalue, else gimplify it into + a temporary, make sure and register it to be renamed if necessary, + and finally return the temporary. Put the statements to compute + EXP before the current statement in BSI. */ + +tree +gimplify_val (block_stmt_iterator *bsi, tree type, tree exp) +{ + tree t, new_stmt, orig_stmt; + + if (is_gimple_val (exp)) + return exp; + + t = make_rename_temp (type, NULL); + new_stmt = build (MODIFY_EXPR, type, t, exp); + + orig_stmt = bsi_stmt (*bsi); + SET_EXPR_LOCUS (new_stmt, EXPR_LOCUS (orig_stmt)); + TREE_BLOCK (new_stmt) = TREE_BLOCK (orig_stmt); + + bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT); + + return t; +} + +/* Build a ternary operation and gimplify it. Emit code before BSI. + Return the gimple_val holding the result. */ + +tree +gimplify_build3 (block_stmt_iterator *bsi, enum tree_code code, + tree type, tree a, tree b, tree c) +{ + tree ret; + + ret = fold (build3 (code, type, a, b, c)); + STRIP_NOPS (ret); + + return gimplify_val (bsi, type, ret); +} + +/* Build a binary operation and gimplify it. Emit code before BSI. + Return the gimple_val holding the result. */ + +tree +gimplify_build2 (block_stmt_iterator *bsi, enum tree_code code, + tree type, tree a, tree b) +{ + tree ret; + + ret = fold (build2 (code, type, a, b)); + STRIP_NOPS (ret); + + return gimplify_val (bsi, type, ret); +} + +/* Build a unary operation and gimplify it. Emit code before BSI. + Return the gimple_val holding the result. */ + +tree +gimplify_build1 (block_stmt_iterator *bsi, enum tree_code code, tree type, + tree a) +{ + tree ret; + + ret = fold (build1 (code, type, a)); + STRIP_NOPS (ret); + + return gimplify_val (bsi, type, ret); +} + + /* Emit return warnings. */ |