]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP/PolyInt: Pass poly-int structures by address to OMP libs.
authorTejas Belagod <tejas.belagod@arm.com>
Mon, 30 Oct 2023 08:17:34 +0000 (13:47 +0530)
committerTejas Belagod <tejas.belagod@arm.com>
Thu, 23 Jan 2025 10:33:07 +0000 (16:03 +0530)
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.

gcc/omp-low.cc

index 4f113df92008ae1a67a740636b48afb2bf368f0b..c36ae38cf8e1f412406554147b0748c5e70ac8a2 100644 (file)
@@ -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