This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi! On Mon, 9 Nov 2015 01:30:34 -0500, Jason Merrill <jason@redhat.com> wrote: > I'm planning to merge the C++ delayed folding branch this week [...] In r230554, <http://news.gmane.org/find-root.php?message_id=%3C564C95C7.8090803%40codesourcery.com%3E>, Cesar already fixed up cp_fold_r to also care for OACC_LOOP, but another thing I just wondered about is whether this function also needs to do something for operand 6 (OMP_FOR_ORIG_DECLS) of OMP_FOR and its variants? If not, would it make sense to note that in a source code comment, given that any other operand is being handled? > --- a/gcc/cp/cp-gimplify.c > +++ b/gcc/cp/cp-gimplify.c > +/* Perform any pre-gimplification folding of C++ front end trees to > + GENERIC. > + Note: The folding of none-omp cases is something to move into > + the middle-end. As for now we have most foldings only on GENERIC > + in fold-const, we need to perform this before transformation to > + GIMPLE-form. */ > + > +static tree > +cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data) > +{ > + tree stmt; > + struct cp_genericize_data *wtd = (struct cp_genericize_data *) data; > + enum tree_code code; > + > + *stmt_p = stmt = cp_fold (*stmt_p, wtd->fold_hash); > + > + code = TREE_CODE (stmt); > + if (code == OMP_FOR || code == OMP_SIMD || code == OMP_DISTRIBUTE > + || code == OMP_TASKLOOP || code == CILK_FOR || code == CILK_SIMD) > + { > + tree x; > + int i, n; > + > + cp_walk_tree (&OMP_FOR_BODY (stmt), cp_fold_r, data, NULL); > + cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_fold_r, data, NULL); > + cp_walk_tree (&OMP_FOR_INIT (stmt), cp_fold_r, data, NULL); > + x = OMP_FOR_COND (stmt); > + if (x && TREE_CODE_CLASS (TREE_CODE (x)) == tcc_comparison) > + { > + cp_walk_tree (&TREE_OPERAND (x, 0), cp_fold_r, data, NULL); > + cp_walk_tree (&TREE_OPERAND (x, 1), cp_fold_r, data, NULL); > + } > + else if (x && TREE_CODE (x) == TREE_VEC) > + { > + n = TREE_VEC_LENGTH (x); > + for (i = 0; i < n; i++) > + { > + tree o = TREE_VEC_ELT (x, i); > + if (o && TREE_CODE_CLASS (TREE_CODE (o)) == tcc_comparison) > + cp_walk_tree (&TREE_OPERAND (o, 1), cp_fold_r, data, NULL); > + } > + } > + x = OMP_FOR_INCR (stmt); > + if (x && TREE_CODE (x) == TREE_VEC) > + { > + n = TREE_VEC_LENGTH (x); > + for (i = 0; i < n; i++) > + { > + tree o = TREE_VEC_ELT (x, i); > + if (o && TREE_CODE (o) == MODIFY_EXPR) > + o = TREE_OPERAND (o, 1); > + if (o && (TREE_CODE (o) == PLUS_EXPR || TREE_CODE (o) == MINUS_EXPR > + || TREE_CODE (o) == POINTER_PLUS_EXPR)) > + { > + cp_walk_tree (&TREE_OPERAND (o, 0), cp_fold_r, data, NULL); > + cp_walk_tree (&TREE_OPERAND (o, 1), cp_fold_r, data, NULL); > + } > + } > + } > + cp_walk_tree (&OMP_FOR_PRE_BODY (stmt), cp_fold_r, data, NULL); > + *walk_subtrees = 0; > + } > + > + return NULL; > +} GrÃÃe Thomas
Attachment:
signature.asc
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |