Skip to content

Commit 4e92c1d

Browse files
committed
[Coroutines] Use default attributes for some coro intrinsics
This adds the default attributes (nosync, nofree, nocallback, willreturn) to the coro.id and coro.subfn.addr intrinsics. This is needed to avoid optimization regressions in the future. It's probably possible to use default attributes for most other coro intrinsics as well, but I only hit these as problematic in practice. Differential Revision: https://reviews.llvm.org/D136932
1 parent fd3d7a9 commit 4e92c1d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,11 +1269,10 @@ def int_experimental_gc_get_pointer_offset : Intrinsic<[llvm_i64_ty],
12691269

12701270
// Coroutine Structure Intrinsics.
12711271

1272-
def int_coro_id : Intrinsic<[llvm_token_ty], [llvm_i32_ty, llvm_ptr_ty,
1273-
llvm_ptr_ty, llvm_ptr_ty],
1274-
[IntrArgMemOnly, IntrReadMem,
1275-
ReadNone<ArgIndex<1>>, ReadOnly<ArgIndex<2>>,
1276-
NoCapture<ArgIndex<2>>]>;
1272+
def int_coro_id : DefaultAttrsIntrinsic<[llvm_token_ty],
1273+
[llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
1274+
[IntrArgMemOnly, IntrReadMem, ReadNone<ArgIndex<1>>, ReadOnly<ArgIndex<2>>,
1275+
NoCapture<ArgIndex<2>>]>;
12771276
def int_coro_id_retcon : Intrinsic<[llvm_token_ty],
12781277
[llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty,
12791278
llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
@@ -1341,10 +1340,10 @@ def int_coro_promise : Intrinsic<[llvm_ptr_ty],
13411340

13421341
// Coroutine Lowering Intrinsics. Used internally by coroutine passes.
13431342

1344-
def int_coro_subfn_addr : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty],
1345-
[IntrReadMem, IntrArgMemOnly,
1346-
ReadOnly<ArgIndex<0>>,
1347-
NoCapture<ArgIndex<0>>]>;
1343+
def int_coro_subfn_addr : DefaultAttrsIntrinsic<
1344+
[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty],
1345+
[IntrReadMem, IntrArgMemOnly, ReadOnly<ArgIndex<0>>,
1346+
NoCapture<ArgIndex<0>>]>;
13481347

13491348
///===-------------------------- Other Intrinsics --------------------------===//
13501349
//

0 commit comments

Comments
 (0)