[PATCH] D116149: [IR] Add memory attributes for init.trampoline

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 02:39:18 PST 2021


nikic created this revision.
nikic added reviewers: reames, fhahn, jdoerfert.
Herald added a subscriber: pengfei.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Based on my reading of https://llvm.org/docs/LangRef.html#llvm-init-trampoline-intrinsic, init.trampoline writes to the first argument, while the other two are readnone. These two arguments are only captured and written into the trampoline memory. This also matches what I see in the `X86TargetLowering::LowerINIT_TRAMPOLINE()` implementation.

Unfortunately the person who originally worked on trampolines doesn't seem to be active anymore, so adding some general memory attribute reviewers... I hope that with this change we can remove special intrinsic handling in MemoryLocation::getForDest().


https://reviews.llvm.org/D116149

Files:
  llvm/include/llvm/IR/Intrinsics.td


Index: llvm/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/include/llvm/IR/Intrinsics.td
+++ llvm/include/llvm/IR/Intrinsics.td
@@ -1019,7 +1019,10 @@
 //
 def int_init_trampoline : Intrinsic<[],
                                     [llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty],
-                                    [IntrArgMemOnly, NoCapture<ArgIndex<0>>]>,
+                                    [IntrArgMemOnly, NoCapture<ArgIndex<0>>,
+                                     WriteOnly<ArgIndex<0>>,
+                                     ReadNone<ArgIndex<1>>,
+                                     ReadNone<ArgIndex<2>>]>,
                                     GCCBuiltin<"__builtin_init_trampoline">;
 
 def int_adjust_trampoline : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty],


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116149.395819.patch
Type: text/x-patch
Size: 827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211222/4e1c6e0d/attachment.bin>


More information about the llvm-commits mailing list