Prazek added a comment. Because now barrier is considered as writing memory, I marked it's argument as nocapture. I am not sure if it is correct, since barrier returns it's pointer. Does it mean that it outlives the barrier? https://reviews.llvm.org/D32006