[PATCH] D124385: AMDGPU: Special case divergence analysis for wave ID computation

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 02:40:36 PST 2022


nhaehnle added a comment.

The code in `isAlwaysUniform` is weirdly non-orthogonal. There are cases above the diff that match for straight-up workitem.id.x-based calculation of a wave ID, but they match `[al]shr` and `and`. And then there's the new code, but that one matches `[su]div`. Why doesn't the `[su]div` become a `[al]shr`?

The logic overall is also not quite convincing.

- Why do the existing checks bail out based on workgroup Y and Z sizes? Okay, probably because of the FIXME above, though that seems sort of fundamental?
- If I understand the new code correctly, it matches the patterns `(groupSize.? * groupId.? + threadId.?)`. If you're covering y and z, isn't it more likely that one finds expressions like `threadId.y * groupSize.y + threadId.x`?
- Also, it still seems like checks against 2D/3D group sizes or odd 1D sizes are still missing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124385/new/

https://reviews.llvm.org/D124385



More information about the llvm-commits mailing list