[OpenMP][FIX] Ensure custom state machine works
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 4 Mar 2022 18:16:29 +0000 (13:16 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 4 Mar 2022 18:51:19 +0000 (13:51 -0500)
commitf9c2d6005ef06a37a99e324e72ce247d0472cf4e
treeb6ff6aafbce8e8c0041f741b2b535a4449ace43e
parent7405581f7ca3ba54be8a04c394a96fe6d980f073
[OpenMP][FIX] Ensure custom state machine works

The custom state machine had a check for surplus threads that filtered
the main thread if the kernel was executed by a single warp only. We
now first check for the main thread, then for surplus threads, avoiding
to filter the former out.

Fixes #54214.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D121011
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/custom_state_machines.ll
llvm/test/Transforms/OpenMP/spmdization.ll
llvm/test/Transforms/OpenMP/spmdization_guarding.ll
llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll