On 1/21/25 10:16 PM, Jakub Jelinek wrote:
On Fri, Oct 18, 2024 at 11:52:22AM +0530, Tejas Belagod wrote:
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.c (use_pointer_for_field): Use pointer if the OMP data
structure's field type is a poly-int.
I think I've acked this one earlier already.
It is still ok.
Thanks Jakub for the reviews. Just to clarify - this series is all now
for Stage 1, I'm guessing?
Thanks,
Tejas.
---
gcc/omp-low.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc
index da2051b0279..6b3853ed528 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
--
2.25.1
Jakub