[PATCH] D137142: [WIP] DivergenceAnalysis: Infer uniformity from assume calls
Simon Moll via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 04:20:49 PST 2023
simoll added a comment.
In D137142#4046742 <https://reviews.llvm.org/D137142#4046742>, @foad wrote:
>> For the DA in isolation, ideally, we'd have something like:
>>
>> %Y = llvm.assume.uniform(%X)
>> foo(%Y) ; <- Rewritten to use %Y instead of %X.
>
> This is roughly what the target-specific @llvm.amdgcn.readfirstlane does today, and some frontends do use it to assert and/or enforce uniformity of particular values. There is some sublety about exactly what it means (or exactly what @llvm.assume.uniform //should// mean): Read the first active lane? Read an arbitrary active lane? Undefined/poison if active lanes do not all have the same value?
Read all active lanes. The intrinsic only tells us that we can assume uniformity among the active lanes in each instance, it could not be used to enforce it. Not so sure about the values on inactive lanes, I'd say it simply passes through the incoming values.. you may just want poison here though..
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137142/new/
https://reviews.llvm.org/D137142
More information about the llvm-commits
mailing list