arsenm added a comment. Doesn't the library already annotate these with the range metadata? We should probably tighten those bounds in a pass when the required workgroup size is known on the IR metadata Repository: rL LLVM https://reviews.llvm.org/D31804