llvm.swift.async.context.addr cannot be modeled as NoMem because we don't want it...
authorArnold Schwaighofer <aschwaighofer@apple.com>
Wed, 20 Jul 2022 20:27:11 +0000 (13:27 -0700)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 22 Jul 2022 18:50:58 +0000 (11:50 -0700)
commit58e6ee0e1f1668ff9dd93e4a4084e36bc79fdf88
tree8f7d31a8dfd1575c5e7d706a1c30f877f44ddb6e
parentcfa6e79df30c7f9ea319d304670dcce7e9376787
llvm.swift.async.context.addr cannot be modeled as NoMem because we don't want it to be cse'd accross async suspends

An async suspend models the split between two partial async functions.
`llvm.swift.async.context.addr ` will have a different value in the two
partial functions so it is not correct to generally CSE the instruction.

rdar://97336162

Differential Revision: https://reviews.llvm.org/D130201
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/Transforms/Coroutines/coro-async-no-cse-swift-async-context-addr.ll [new file with mode: 0644]