[PATCH] D118185: [AMDGPU] Mark v_cmp* convergent

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 09:42:41 PST 2022


rampitec added a comment.

In D118185#3271905 <https://reviews.llvm.org/D118185#3271905>, @foad wrote:

> Right, an ordinary V_CMP is still sinkable because of the way the result is used, there is an implicit guarantee that bits in the result corresponding to inactive lanes (at the point of use) will be ignored.

I see it that way: technically HW instruction is convergent. If it would not mask the result with exec it would not be convergent. Then you are right we can ignore this fact given the promise of the at least somewhat structured control flow. Then the use of the intrinsic breaks the promise and essentially stepping into the crosslane territory. Although that is not a property of the instruction but rather of its use.

I.e. marking compares as convergent seems to be safe, the other question is if it is desired or not.


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

https://reviews.llvm.org/D118185



More information about the llvm-commits mailing list