[PATCH] D130201: llvm.swift.async.context.addr cannot be modeled as NoMem because we don't want it to be cse'd accross async suspends

Arnold Schwaighofer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 08:13:16 PDT 2022


aschwaighofer added inline comments.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:498
 // would otherwise be unneeded.
-def int_swift_async_context_addr : Intrinsic<[llvm_ptrptr_ty], [], [IntrNoMem]>;
+def int_swift_async_context_addr : Intrinsic<[llvm_ptrptr_ty], [], []>;
 
----------------
Hmm. We could be a little less conservative and mark the intrinsic as `IntrReadMem`. The suspend intrinsic does write to memory so the required ordering would be maintained.

In practice, I don't think it matters much because the way we use this intrinsic is to store to its result:

```
 %addr = call i8** @llvm.swift.async.context.addr()
 store i8* %something, i8** %addr
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130201



More information about the llvm-commits mailing list