[PATCH] D147719: [OpenMP] Replace HeapToShared's initial value with `poison`

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 11:00:40 PDT 2023


jhuber6 added subscribers: nlopes, arsenm.
jhuber6 added a comment.

In D147719#4249322 <https://reviews.llvm.org/D147719#4249322>, @tra wrote:

> In D147719#4249298 <https://reviews.llvm.org/D147719#4249298>, @jhuber6 wrote:
>
>> This was in reponse to https://reviews.llvm.org/D147572 suggesting that we use `poison` in general over `undef`. I feel the semantics are roughly equivalent here, so I don't think this patch changes any existing behavior. All of these values get `addrspacecast`ed before they're used, but as far as I know those simply propagate poison values and don't imply any sort of volatility.
>
> I'm somewhat concerned about this property of poison <https://llvm.org/docs/LangRef.html#poison-values>: "It is correct to replace a poison value with an undef value or any value of the type."
>
> The way I read it, poison *may* make it possible to assume whatever value is convenient for optimization passes, which is not what we want for the values read from shared memory.

I'm not exactly sure on the details here, maybe @nlopes or @arsenm could elaborate? I don't know if we already handle these access to `addressspace(3)` the way you described.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147719



More information about the llvm-commits mailing list