[PATCH] D26348: Allow convergent attribute for function arguments
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 11:45:58 PST 2017
mehdi_amini added a comment.
> //Example 1: Safe to fold.
> void foo(int v, bool cond) {
>
> if (cond) {
> // token1 = statepoint()
> // bar(v, token1); // v needs to be convergent
> } else {
> // token2 = statepoint()
> // bar(v, token2); // v needs to be convergent
> }
> token_merged = statepoint()
> bar(v, token_merged); // v needs to be convergent
>
> }
My understanding was that this is *not* OK to fold, we don't know that two different "thread" have the same value for v. Can you elaborate, it is very possible that I'm misunderstanding something here.
https://reviews.llvm.org/D26348
More information about the llvm-commits
mailing list