https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97291
Bug ID: 97291 Summary: [SIMT] Move SIMT_XCHG_* out of non-uniform execution region Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- We have: ... /* Allocate per-lane storage and begin non-uniform execution region. */ static void expand_GOMP_SIMT_ENTER_ALLOC (internal_fn, gcall *stmt) ... and: ... /* Deallocate per-lane storage and leave non-uniform execution region. */ static void expand_GOMP_SIMT_EXIT (internal_fn, gcall *stmt) ... So, if the SIMT_ENTER_ALLOC and the SIMT_EXIT mark the start and end of a region of non-uniform execution, it's strange that such a region can contain SIMT_XCHG_*, which on nvptx requires uniform execution. Moving SIMT_VOTE_ANY/SIMT_LAST_LANE/SIMT_XCHG_* as a whole after SIMT_EXIT is not possible given that VOTE_ANY may have data dependencies to storage that is deallocated by SIMT_EXIT (as Alexander mentioned here: https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555475.html). A possible solution would be to split the SIMT_EXIT into separate bits for exiting non-uniform execution and deallocation, and have: - SIMT_ENTER_ALLOC - SIMT_EXIT_UNI - SIMT_VOTE_ANY/SIMT_LAST_LANE/SIMT_XCHG_* - SIMT_EXIT_DEALLOC Also I've wondered if we could do: - SIMT_ENTER_ALLOC - SIMT_VOTE_ANY - SIMT_EXIT - SIMT_LAST_LANE/SIMT_XCHG_* but perhaps there are again data dependency problems.