[OpenMP][DeviceRTL] Fixed an issue that causes hang in SU3
authorShilei Tian <tianshilei1992@gmail.com>
Sat, 30 Oct 2021 18:43:59 +0000 (14:43 -0400)
committerShilei Tian <tianshilei1992@gmail.com>
Sat, 30 Oct 2021 18:44:29 +0000 (14:44 -0400)
commit025f5492401489269ab980910f4fda98f5b06bd1
treed97ef0309015f69ab136c6dbb068a1fcf59ac8cb
parent931d20c5db05fc2e2f4071cc086fa3ff1b4aebdd
[OpenMP][DeviceRTL] Fixed an issue that causes hang in SU3

The synchronization at the end of parallel region cannot make sure all threads
exit the scope. As a result, the assertions right after it might be hit, and
further the `state::assumeInitialState(IsSPMD)` in `__kmpc_target_deinit` may
not hold as well. We either add a synchronization right after the parallel region,
or remove the assertions and assuptions. Here we choose the first one as those
assertions and assumptions can help optimizations.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D112861
openmp/libomptarget/DeviceRTL/src/Parallelism.cpp