Usually for serialized tasks (with if(0)), __kmpc_omp_task_begin_if0 is used.
This does not allow to track outgoing dependencies in case of detached tasks (see https://bugs.llvm.org/show_bug.cgi?id=46185).
Similarly, mutexinoutset would rather block than execute the task immediately.
This patch will allow to generate code as for normal tasks, but mark the task as undeferrable.
The task_serial bit supposed to be used internally by the library, not by compiler (we virtually split 32-bit flag in two parts - lower 16 bits owned by compiler, higher 16 bits owned by the library).
I'd suggest to use if0 bit instead which is "compiler-owned". It is named in the library merged_if0 (don't know why) and never used currently. We could also rename it, but not necessarily. We will unlikely use this bit for mergeable tasks because it is hard to implement mergeable tasks in the library with a little gain (does not worth efforts to me, at least for now).
So for explicit tied if0 detachable task compiler could use the flag 69 which is binary 0100 0101 with bits 0, 2, 6 set (0 - tied, 2 - if0, 6 - detachable).
WDYT?