[OpenMP] Avoid calling `isSPMDMode` during RT initialization

Until we hit the first barrier we should not call `mapping::isSPMDMode`
with all threads. Instead, we now have (and use during initialization) a
`mapping::isMainThreadInGenericMode` overload that takes the known
SPMD-mode state and one that queries it.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D111381

GitOrigin-RevId: 85ad56633593d011ab00f4eb431ffd879677bffc
4 files changed