From: Nikita Popov Date: Fri, 28 Oct 2022 09:42:10 +0000 (+0200) Subject: [Coroutines] Use default attributes for some coro intrinsics X-Git-Tag: upstream/17.0.6~29008 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e92c1d9737a3694cd75a321f45b03c3d038e069;p=platform%2Fupstream%2Fllvm.git [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 --- 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 --------------------------===// //