[PATCH] D151341: AMDGPU: Special case uniformity info for singlethreaded workitem IDs
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 06:46:22 PDT 2023
jhuber6 added a comment.
In D151341#4380694 <https://reviews.llvm.org/D151341#4380694>, @nhaehnle wrote:
> But even beyond that: it is reasonably common to have compute shaders that do something like this:
>
> if (threadid == 0) {
> ...
> }
>
> So it would be interesting to be able to handle this more generally in UniformityAnalysis, perhaps by having a callback that analyzes conditional branches and returns whether one side of the branch is entered by at most one lane.
>
> Once that's the long-term goal, it seems plausible to me to make `isSingleLaneExecution(Function &)` a callback that is accessible to UniformityAnalysis, as opposed to querying it from isSourceOfDivergence.
We have a similar check for that explicit case in the `OpenMPOpt` pass https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/IPO/OpenMPOpt.cpp#L2760.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151341/new/
https://reviews.llvm.org/D151341
More information about the llvm-commits
mailing list