E6019

E6019 — raw::barrier() anywhere but a top-level statement of the lowering body. The barrier's contract requires every lane to reach it; under a conditional or a loop that cannot be guaranteed syntactically, so it is rejected outright (conservative by design — restructure the body so the barrier is unconditional).

What the compiler reports

E6019
reachable by every lane

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

// raw::barrier() under a loop: every lane must reach a barrier, and inside
// control flow that cannot be guaranteed syntactically. Rejected outright.
Topology Dev {
  memory: Memory::L2,
  visible: [Memory::L2, Memory::SMEM],
  transfer Memory::CPU_DRAM -> Memory::L2 : 10 GB/s,
  transfer Memory::L2 -> Memory::SMEM
}
impl Transfer<Memory::L2, Memory::SMEM> for Topology::Dev {
  fn move_tile(src: &Tensor<f32, [4]>, dst: &mut Tensor<f32, [4]>) -> i32 {
    for i in 0..raw::extent(src) {
      raw::store(dst, i, raw::load(src, i));
      raw::barrier();
    }
    return 0;
  }
}
fn main() -> i32 {
  return 0;
}

From tests/middle_end/fail/raw_barrier_divergent.vx, which asserts this diagnostic on every commit.

Related