Message ID | 87k2rizdzi.fsf@kepler.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
On 09/22/15 11:10, Thomas Schwinge wrote: > Hi! > > On Fri, 18 Sep 2015 20:05:48 -0400, Nathan Sidwell <nathan@acm.org> wrote: >> I've committed this patch to rework and simplify [...] >> the reduction lowering hooks. >> >> The current implementation [...] >> [was] overcomplicated in a number of ways. > >> * 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_redutction_init_op. > > Should this go into trunk already? (I can test it, if you'd like me to.) go for it! nathan
diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index e70d6cb..b7dbba0 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,8 @@ +2015-09-22 Thomas Schwinge <thomas@codesourcery.com> + + * tree-parloops.c (initialize_reductions): Remove local variable + bvar. + 2015-09-18 Nathan Sidwell <nathan@codesourcery.com> * omp-low.h (omp_reduction_init_op): Declare. diff --git gcc/tree-parloops.c gcc/tree-parloops.c index 5062732..04ec254 100644 --- gcc/tree-parloops.c +++ gcc/tree-parloops.c @@ -567,7 +567,7 @@ int initialize_reductions (reduction_info **slot, struct loop *loop) { tree init; - tree bvar, type, arg; + tree type, arg; edge e; struct reduction_info *const reduc = *slot; @@ -578,10 +578,8 @@ 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"); - init = omp_reduction_init_op (gimple_location (reduc->reduc_stmt), reduc->reduction_code, type); reduc->init = init;