From 4e92c1d9737a3694cd75a321f45b03c3d038e069 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 28 Oct 2022 11:42:10 +0200 Subject: [PATCH] [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 --- llvm/include/llvm/IR/Intrinsics.td | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td index 025dd80..bfe69f3 100644 --- a/llvm/include/llvm/IR/Intrinsics.td +++ b/llvm/include/llvm/IR/Intrinsics.td @@ -1269,11 +1269,10 @@ def int_experimental_gc_get_pointer_offset : Intrinsic<[llvm_i64_ty], // Coroutine Structure Intrinsics. -def int_coro_id : Intrinsic<[llvm_token_ty], [llvm_i32_ty, llvm_ptr_ty, - llvm_ptr_ty, llvm_ptr_ty], - [IntrArgMemOnly, IntrReadMem, - ReadNone>, ReadOnly>, - NoCapture>]>; +def int_coro_id : DefaultAttrsIntrinsic<[llvm_token_ty], + [llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty], + [IntrArgMemOnly, IntrReadMem, ReadNone>, ReadOnly>, + NoCapture>]>; def int_coro_id_retcon : Intrinsic<[llvm_token_ty], [llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty], @@ -1341,10 +1340,10 @@ def int_coro_promise : Intrinsic<[llvm_ptr_ty], // Coroutine Lowering Intrinsics. Used internally by coroutine passes. -def int_coro_subfn_addr : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty], - [IntrReadMem, IntrArgMemOnly, - ReadOnly>, - NoCapture>]>; +def int_coro_subfn_addr : DefaultAttrsIntrinsic< + [llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty], + [IntrReadMem, IntrArgMemOnly, ReadOnly>, + NoCapture>]>; ///===-------------------------- Other Intrinsics --------------------------===// // -- 2.7.4