diff options
author | Tejas Belagod <tejas.belagod@arm.com> | 2023-10-30 13:47:34 +0530 |
---|---|---|
committer | Tejas Belagod <tejas.belagod@arm.com> | 2025-01-23 16:03:07 +0530 |
commit | b8ac06163e485547ece41ea802dfdc94b18ce134 (patch) | |
tree | add3c97ca9cd51ab9ae489e1fec7e9d0fce3eec8 /gcc/omp-low.cc | |
parent | 314d20bbefd098ff75b366b870ac8e33ad7711ca (diff) | |
download | gcc-b8ac06163e485547ece41ea802dfdc94b18ce134.zip gcc-b8ac06163e485547ece41ea802dfdc94b18ce134.tar.gz gcc-b8ac06163e485547ece41ea802dfdc94b18ce134.tar.bz2 |
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.
Diffstat (limited to 'gcc/omp-low.cc')
-rw-r--r-- | gcc/omp-low.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 4f113df..c36ae38 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 |