Neither deleted barrier test could see a barrier that fences the wrong memory: the
out-of-line barrier test passes both flags (3) and the threadgroup sum runs one wave a
threadgroup on RADV. Beside the tests as they stood, these variants run threadgroups of 128
threads (more than one wave on every device) in which thread t reads what thread t ^ 64
wrote, over four rounds as a tiled kernel's loop runs them, against an answer computed in
the test:
- a barrier of OpenCL's CLK_LOCAL_MEM_FENCE (1) alone over threadgroup memory,
CLK_GLOBAL_MEM_FENCE (2) alone over device memory, and both (3) over each, passed on as
Apple's OpenCL compiler passes it (`tail call fastcc void @_Z7barrierj(i32 noundef 1)`
to an out-of-line wrapper of air.wg.barrier): in a plain pipeline through the two-operand
air.wg.barrier (the out-of-line barrier test's form), and in a pipeline of OpenCL mode
through it and through the three-operand form the work-item kernel's wrapper uses;
- a fence of the same flags in a plain pipeline, through the out-of-line fence test's
llvm.bitreverse.i2 shape: the data crosses through the fence, barrier(0) and the fence
again, since a fence orders only its own thread's accesses.
Verified: the lavapipe run follows.