https://gcc.gnu.org/g:9708d9933b0cc59a3dd9771cddd314f4fb53f1cc
commit 9708d9933b0cc59a3dd9771cddd314f4fb53f1cc Author: Andrew Stubbs <[email protected]> Date: Thu Nov 12 11:41:23 2026 +0000 OG16 SIMT fixups These edits fix backport issues that were not initially spotted in the backport. I'm keeping them separate because this probably isn't the last time I will revert and re-merge this patchset. gcc/ChangeLog: * function.cc (assign_stack_temp_for_type): Add "addr" variable. libgomp/ChangeLog: * loop.c (GOMP_loop_static_worksharing): Remove parameter. * parallel.c (GOMP_loop_static_worksharing): Delete old version. * single.c (GOMP_single_copy_wait): gomp_team_barrier_wait doesn't need the team_id. Diff: --- gcc/function.cc | 3 ++- libgomp/loop.c | 3 +-- libgomp/parallel.c | 12 ------------ libgomp/single.c | 2 +- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/gcc/function.cc b/gcc/function.cc index 0f678be8633e..c8022d826514 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -993,6 +993,7 @@ assign_stack_temp_for_type (machine_mode mode, poly_int64 size, tree type) insert_temp_slot_address (XEXP (p->slot, 0), p); /* Select this SIMT thread's copy. */ + rtx addr = XEXP (p->slot, 0); rtx lane_addr = simt_stack_object_address (addr, lane_size); if (lane_addr != addr) { @@ -1001,7 +1002,7 @@ assign_stack_temp_for_type (machine_mode mode, poly_int64 size, tree type) } /* Create a new MEM rtx to avoid clobbering MEM flags of old slots. */ - slot = gen_rtx_MEM (mode, XEXP (p->slot, 0)); + slot = gen_rtx_MEM (mode, addr); vec_safe_push (stack_slot_list, slot); /* If we know the alias set for the memory that will be used, use diff --git a/libgomp/loop.c b/libgomp/loop.c index 96a256bdb93e..20a4ddc3fab0 100644 --- a/libgomp/loop.c +++ b/libgomp/loop.c @@ -1209,8 +1209,7 @@ GOMP_loop_ordered_guided_next (long *istart, long *iend) number of iterations. */ _Complex int -GOMP_loop_static_worksharing (unsigned long long niter - __attribute__ ((unused))) +GOMP_loop_static_worksharing () { struct gomp_team *team = gomp_thread ()->ts.team; unsigned tid = GOMP_TID_TO_OMP_TID (gomp_thread ()->ts.team_id); diff --git a/libgomp/parallel.c b/libgomp/parallel.c index 47bf7d86ba62..18483d02b3fa 100644 --- a/libgomp/parallel.c +++ b/libgomp/parallel.c @@ -277,18 +277,6 @@ GOMP_cancel (int which, bool do_cancel) return true; } -/* For a worksharing-loop construct with static schedule, return the thread ID - and number of threads packed into a single complex value. */ - -_Complex int -GOMP_loop_static_worksharing (void) -{ - struct gomp_team *team = gomp_thread ()->ts.team; - unsigned tid = gomp_thread ()->ts.team_id; - unsigned nthreads = team ? team->nthreads : 1; - return nthreads + tid * 1I; -} - /* Return true if the current thread number equals TID. Used to implement the masked construct's filter clause. */ diff --git a/libgomp/single.c b/libgomp/single.c index a7a1e404ce5d..2dbb000360f2 100644 --- a/libgomp/single.c +++ b/libgomp/single.c @@ -175,7 +175,7 @@ GOMP_single_copy_wait (void *data) if (data != NULL) thr->ts.work_share->copyprivate = data; - gomp_team_barrier_wait (&team->barrier, thr->ts.team_id); + gomp_team_barrier_wait (&team->barrier); ret = thr->ts.work_share->copyprivate; gomp_work_share_end_nowait ();
