[PATCH] D53160: AMDGPU: Avoid selecting ds_{read,write}2_b32 on SI

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 08:35:52 PDT 2018


nhaehnle added a comment.

In https://reviews.llvm.org/D53160#1266994, @arsenm wrote:

> LGTM. Is this only actually a problem with the UB because we don't bother trying to set m0 to the allocated size?


Thanks. Not quite, the issue is that the shader //actually// does an out-of-bounds load. That would be UB in a normal language, except that GLSL actually says it's okay in this case. Of course the shader doesn't use the resulting value (there's a loop, and the shader loads two adjacent i32 values in each loop iteration, from indices `n-1` and `n`; the `n-1` part ends up not contributing to the calculation during the first iteration).


Repository:
  rL LLVM

https://reviews.llvm.org/D53160





More information about the llvm-commits mailing list