arsenm added a comment. I think this is a legal transformation. For example if you have a barrier like this with a divergent condition, the source program is broken. You can infer from this that %cond is a uniform condition https://reviews.llvm.org/D30921