[PATCH] D14386: [Statepoints] Mark gc.result and gc.relocate as readonly

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 10:02:33 PST 2015


igor-laevsky created this revision.
igor-laevsky added reviewers: sanjoy, reames.
igor-laevsky added a subscriber: llvm-commits.
igor-laevsky set the repository for this revision to rL LLVM.

Semantically gc.result and gc.relocate can be considered as readonly functions. This will allow llvm more freedom is finding optimal placement for this intrinsics. The only thing we want to prevent is reordering of the gc.relocates across different statepoints. And this shouldn't happen since we model statepoints as writing calls.

Repository:
  rL LLVM

http://reviews.llvm.org/D14386

Files:
  include/llvm/IR/Intrinsics.td

Index: include/llvm/IR/Intrinsics.td
===================================================================
--- include/llvm/IR/Intrinsics.td
+++ include/llvm/IR/Intrinsics.td
@@ -551,9 +551,11 @@
                                 llvm_i32_ty, llvm_vararg_ty],
                                 [Throws]>;
 
-def int_experimental_gc_result   : Intrinsic<[llvm_any_ty], [llvm_i32_ty]>;
+def int_experimental_gc_result   : Intrinsic<[llvm_any_ty], [llvm_i32_ty],
+                                             [IntrReadMem]>;
 def int_experimental_gc_relocate : Intrinsic<[llvm_anyptr_ty],
-                                [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty]>;
+                                [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
+                                [IntrReadMem]>;
 
 // Deprecated: will be removed in a couple of weeks
 def int_experimental_gc_result_int : Intrinsic<[llvm_anyint_ty], [llvm_i32_ty]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14386.39377.patch
Type: text/x-patch
Size: 917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151105/b9a0ed12/attachment.bin>


More information about the llvm-commits mailing list