[clang] [llvm] [mlir] [LLVM/Clang/MLIR] Overload Switch-ABI coroutine intrinsics over pointer address space (PR #245324)
Vlad Sytchenko via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 1 19:15:58 PST 2026
================
@@ -2058,31 +2058,31 @@ def int_coro_alloca_free : Intrinsic<[], [llvm_token_ty], []>;
// Coroutine Manipulation Intrinsics.
-def int_coro_resume : Intrinsic<[], [llvm_ptr_ty], [Throws]>;
-def int_coro_destroy : Intrinsic<[], [llvm_ptr_ty], [Throws]>;
-def int_coro_done : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty],
+def int_coro_resume : Intrinsic<[], [llvm_anyptr_ty], [Throws]>;
+def int_coro_destroy : Intrinsic<[], [llvm_anyptr_ty], [Throws]>;
+def int_coro_done : Intrinsic<[llvm_i1_ty], [llvm_anyptr_ty],
[IntrArgMemOnly, ReadOnly<ArgIndex<0>>,
NoCapture<ArgIndex<0>>]>;
-def int_coro_promise : Intrinsic<[llvm_ptr_ty],
- [llvm_ptr_ty, llvm_i32_ty, llvm_i1_ty],
+def int_coro_promise : Intrinsic<[llvm_anyptr_ty],
+ [LLVMMatchType<0>, llvm_i32_ty, llvm_i1_ty],
[IntrNoMem, NoCapture<ArgIndex<0>>]>;
def int_coro_await_suspend_void : Intrinsic<[],
- [llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
+ [llvm_anyptr_ty, llvm_anyptr_ty, llvm_ptr_ty],
[Throws]>;
def int_coro_await_suspend_bool : Intrinsic<[llvm_i1_ty],
- [llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
+ [llvm_anyptr_ty, llvm_anyptr_ty, llvm_ptr_ty],
----------------
vsytch wrote:
The awaiter object pointer doesn't need to live in the same address space as the coroutine's frame pointer as far as I understand. I haven't gotten to this point yet in my coroutine adventures, but this case will trigger in the presence of both a scalar and vector stack. I believe we'll need more fixes then, but we'll cross that bridge when we get to it.
https://github.com/llvm/llvm-project/pull/245324
More information about the cfe-commits
mailing list