Apple's OpenCL compiler (Metal's OpenCL mode) writes mem_fence(flags) as
air.atomic.fence(flags, 4, 1): order 4, acq_rel, after its trunc, llvm.bitreverse.i2 and zext
of the flags; read_mem_fence takes order 2 and write_mem_fence order 3 (the probe
opencl_operand_encodings, M3 Max, job m3-max-76799; the module text read again in job
m3-max-76855). The test modules that stand for mem_fence wrote order 3, a release fence, which
puts a fence weaker than Apple's on the side that reads: opencl_kernels's FENCE,
opencl_barriers's _Z9mem_fencej and unbound_immediates's fence. Each now writes order 4, and the
canon test asserts the fence it binds is acq_rel. None of the three stands for write_mem_fence,
so none keeps order 3.
A test correction only: no product code changes. The before and after runs of the two device
tests on one card per vendor follow this commit.