[PATCH] D115302: GlobalsModRef should treat functions w/o nosync conservatively.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 16:07:59 PST 2021


jdoerfert added a comment.

In D115302#3181315 <https://reviews.llvm.org/D115302#3181315>, @tra wrote:

> In D115302#3181294 <https://reviews.llvm.org/D115302#3181294>, @jdoerfert wrote:
>
>> But then I'm confused. The code that is patched here is generic for calls, no? I think this is a particular intrinsic issue.
>
> I don't know why `@llvm.sync` and `@sync` are treated differently in your example. I doubt this  patch will change that.
>
> On the other hand,  both `@llvm.sync` and `@sync` are just functions w/o `nosync` (and no other relevant attributes) and that is sufficient to treat them conservatively with this patch in place.
>
> It's quite possible that in your case this patch only masks the issue.

It seems the function w/o `nosycn` is already treated as potential clobber of the global while the intrinsic is not. This patch now "unifies" it by looking for nosync at the call site, but maybe we should not pretend intrinsics are special. 
Here is your original example with a function instead of an intrinsic, all seems to work just fine: https://godbolt.org/z/7cn8jKz17


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115302



More information about the llvm-commits mailing list