[PATCH] D81806: [DivergenceAnalysis] mark join of divergent loop exits
Sameer Sahasrabuddhe via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 16 07:10:09 PDT 2020
sameerds added a comment.
In D81806#2095605 <https://reviews.llvm.org/D81806#2095605>, @madhur13490 wrote:
> bb1:
> %m.uni = <uni>
> %n.uni = <uni>
> br <uni>, %bb2, %bb3
>
> bb2: [..]
> br <div>, %bb2, %bb3
>
> bb3:
> %x.uni = phi [%m.uni, %bb2], [%n.uni %bb1] <-- divergent loop exit that is not join divergent
>
>
> I am new to this party. Why is `%x` marked as `uni`? Its value will differ amongst threads as branch in bb2 is divergent. Is my understanding incorrect?
Here, threads exit bb2 on different iterations because of the divergent branch, but when they converge at bb3, they all assign the same value %m.uni to %x.uni. And since bb1 has a uniform exit, either all threads reach here directly from bb1, or they all reach here from bb2. So the value of %x.uni is uniformly %n.uni or %m.uni respectively.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81806/new/
https://reviews.llvm.org/D81806
More information about the llvm-commits
mailing list