From: Tejas Belagod Date: Mon, 30 Oct 2023 08:17:34 +0000 (+0530) Subject: OpenMP/PolyInt: Pass poly-int structures by address to OMP libs. X-Git-Tag: basepoints/gcc-16~2396 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8ac06163e485547ece41ea802dfdc94b18ce134;p=thirdparty%2Fgcc.git OpenMP/PolyInt: Pass poly-int structures by address to OMP libs. Currently poly-int type structures are passed by value to OpenMP runtime functions for shared clauses etc. This patch improves on this by passing around poly-int structures by address to avoid copy-overhead. gcc/ChangeLog: * omp-low.cc (use_pointer_for_field): Use pointer if the OMP data structure's field type is a poly-int. --- diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 4f113df9200..c36ae38cf8e 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -466,7 +466,8 @@ static bool use_pointer_for_field (tree decl, omp_context *shared_ctx) { if (AGGREGATE_TYPE_P (TREE_TYPE (decl)) - || TYPE_ATOMIC (TREE_TYPE (decl))) + || TYPE_ATOMIC (TREE_TYPE (decl)) + || POLY_INT_CST_P (DECL_SIZE (decl))) return true; /* We can only use copy-in/copy-out semantics for shared variables