diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2015-09-23 16:46:55 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2015-09-23 16:46:55 +0200 |
commit | f2c9f71da9fd748bb452e69e7825e5f28e7c741d (patch) | |
tree | ee3493395b810e3e0800b948507eda00f9269e2e /gcc/tree-parloops.c | |
parent | ef537cc859dd149230454398078da6d3128cfd9a (diff) | |
download | gcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.zip gcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.tar.gz gcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.tar.bz2 |
Refactor omp_reduction_init: omp_reduction_init_op
gcc/
* omp-low.h (omp_reduction_init_op): Declare.
* omp-low.c (omp_reduction_init_op): New, broken out of ...
(omp_reduction_init): ... here. Call it.
* tree-parloops.c (initialize_reductions): Use
omp_reduction_init_op.
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
From-SVN: r228052
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r-- | gcc/tree-parloops.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 8deddb1..741392b 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -565,8 +565,8 @@ reduc_stmt_res (gimple *stmt) int initialize_reductions (reduction_info **slot, struct loop *loop) { - tree init, c; - tree bvar, type, arg; + tree init; + tree type, arg; edge e; struct reduction_info *const reduc = *slot; @@ -577,16 +577,10 @@ initialize_reductions (reduction_info **slot, struct loop *loop) /* In the phi node at the header, replace the argument coming from the preheader with the reduction initialization value. */ - /* Create a new variable to initialize the reduction. */ + /* Initialize the reduction. */ type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); - bvar = create_tmp_var (type, "reduction"); - - c = build_omp_clause (gimple_location (reduc->reduc_stmt), - OMP_CLAUSE_REDUCTION); - OMP_CLAUSE_REDUCTION_CODE (c) = reduc->reduction_code; - OMP_CLAUSE_DECL (c) = SSA_NAME_VAR (reduc_stmt_res (reduc->reduc_stmt)); - - init = omp_reduction_init (c, TREE_TYPE (bvar)); + init = omp_reduction_init_op (gimple_location (reduc->reduc_stmt), + reduc->reduction_code, type); reduc->init = init; /* Replace the argument representing the initialization value |