[llvm] 4e92c1d - [Coroutines] Use default attributes for some coro intrinsics
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 01:39:31 PDT 2022
Author: Nikita Popov
Date: 2022-10-31T09:39:22+01:00
New Revision: 4e92c1d9737a3694cd75a321f45b03c3d038e069
URL: https://github.com/llvm/llvm-project/commit/4e92c1d9737a3694cd75a321f45b03c3d038e069
DIFF: https://github.com/llvm/llvm-project/commit/4e92c1d9737a3694cd75a321f45b03c3d038e069.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/IR/Intrinsics.td
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 025dd8000a7e..bfe69f3bd76d 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<ArgIndex<1>>, ReadOnly<ArgIndex<2>>,
- NoCapture<ArgIndex<2>>]>;
+def int_coro_id : DefaultAttrsIntrinsic<[llvm_token_ty],
+ [llvm_i32_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
+ [IntrArgMemOnly, IntrReadMem, ReadNone<ArgIndex<1>>, ReadOnly<ArgIndex<2>>,
+ NoCapture<ArgIndex<2>>]>;
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<ArgIndex<0>>,
- NoCapture<ArgIndex<0>>]>;
+def int_coro_subfn_addr : DefaultAttrsIntrinsic<
+ [llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty],
+ [IntrReadMem, IntrArgMemOnly, ReadOnly<ArgIndex<0>>,
+ NoCapture<ArgIndex<0>>]>;
///===-------------------------- Other Intrinsics --------------------------===//
//
More information about the llvm-commits
mailing list