Hi Paul-Antoine!

On 2026-07-07T18:12:58+0200, Paul-Antoine Arras <[email protected]> wrote:
> On 07/07/2026 09:19, Thomas Schwinge wrote:
>> On 2026-07-02T15:22:34+0200, Paul-Antoine Arras <[email protected]> wrote:
>>> Add parameter to GOMP_{loop,distribute}_static_worksharing{,_start} 
>>> carrying the
>>> total number of loop iterations. niter is unused for now, pending OMPT
>>> implementation.

> I had run the testsuite on amdgcn and fixed the 
> loop-counter-variable-type issue, but it seems to have gotten lost in a 
> rebase or something :sigh:

Yeah, I've had that happen, too.  ;-)

> Anyway, thanks for the fixup patch -- I re-ran the testsuite with it and 
> it now works.
>
> The attached patch has it squashed in, the trailer added and the 
> ChangeLog updated.

Thanks!  OK to push with the following items addressed.

> --- gcc/omp-expand.cc
> +++ gcc/omp-expand.cc

> @@ -5236,31 +5200,69 @@ expand_omp_for_static_nochunk (struct omp_region 
> *region,

>        gcc_assert (innerc);
>        n2 = OMP_CLAUSE_DECL (innerc);
>      }
> -  n1 = force_gimple_operand_gsi (&gsi, fold_convert (type, n1),
> -                              true, NULL_TREE, true, GSI_SAME_STMT);
> -  n2 = force_gimple_operand_gsi (&gsi, fold_convert (itype, n2),
> -                              true, NULL_TREE, true, GSI_SAME_STMT);
> -  step = force_gimple_operand_gsi (&gsi, fold_convert (itype, step),
> -                                true, NULL_TREE, true, GSI_SAME_STMT);
> +  n1 = force_gimple_operand_gsi (&gsi, fold_convert (type, n1), true, 
> NULL_TREE,
> +                              true, GSI_SAME_STMT);
> +  n2 = force_gimple_operand_gsi (&gsi, fold_convert (itype, n2), true,
> +                              NULL_TREE, true, GSI_SAME_STMT);
> +  step = force_gimple_operand_gsi (&gsi, fold_convert (itype, step), true,
> +                                NULL_TREE, true, GSI_SAME_STMT);
>  
>    t = build_int_cst (itype, (fd->loop.cond_code == LT_EXPR ? -1 : 1));
>    t = fold_build2 (PLUS_EXPR, itype, step, t);

(Might drop this reformatting, too?)

> --- libgomp/libgomp_g.h
> +++ libgomp/libgomp_g.h

> @@ -144,6 +144,14 @@ extern void GOMP_loop_end (void);
>  extern void GOMP_loop_end_nowait (void);
>  extern bool GOMP_loop_end_cancel (void);
>  
> +extern _Complex int GOMP_loop_static_worksharing (unsigned long long);
> +extern _Complex int GOMP_loop_static_worksharing_start (unsigned long long);
> +extern void GOMP_loop_static_worksharing_dispatch (void);
> +extern void GOMP_loop_static_worksharing_end (void);

That patch hunk can't apply on top of the
v2 "openmp: Add OMPT entry points for worksharing-loop, single, and masked 
constructs".

> +
> +extern bool GOMP_has_masked_thread_num (int);
> +extern void GOMP_masked_end (void);
> +

Those two stay in the 'parallel.c' section:

>  /* loop_ull.c */
>  
>  extern bool GOMP_loop_ull_static_start (bool, unsigned long long,
> @@ -297,8 +305,6 @@ extern unsigned GOMP_parallel_reductions (void (*) (void 
> *), void *, unsigned,
>                                         unsigned);
>  extern bool GOMP_cancel (int, bool);
>  extern bool GOMP_cancellation_point (int);
> -extern bool GOMP_has_masked_thread_num (int);
> -extern __complex__ int GOMP_loop_static_worksharing (void);

... if that's where their implementation remains.

>  
>  /* task.c */
>  
> @@ -379,7 +385,10 @@ extern void *GOMP_target_map_indirect_ptr (void *);
>  
>  extern void GOMP_teams_reg (void (*) (void *), void *, unsigned, unsigned,
>                           unsigned);
> -extern __complex__ int GOMP_distribute_static_worksharing (void);
> +extern _Complex int GOMP_distribute_static_worksharing (unsigned long long);
> +extern _Complex int GOMP_distribute_static_worksharing_start (unsigned long 
> long);
> +extern void GOMP_distribute_static_worksharing_dispatch (void);
> +extern void GOMP_distribute_static_worksharing_end (void);
>  
>  /* allocator.c */
>  


Grüße
 Thomas

Reply via email to