[PATCH] [Inliner] Teach LLVM to inline through statepoints.

Pat Gavlin pagavlin at microsoft.com
Fri Jun 26 11:08:51 PDT 2015


This is looking quite a bit better. I'm going to hold off on accepting this patch until Chandler has had a chance to follow up on http://reviews.llvm.org/D10631, however.


================
Comment at: include/llvm/IR/CallSite.h:115
@@ +114,3 @@
+        LiteralDest->getIntrinsicID() == Intrinsic::experimental_gc_statepoint)
+      return dyn_cast<FunTy>(getArgument(2));
+
----------------
>From the previous review:

> I think there is scope to (at least) extract out a StatepointOffsets struct with all of the constants encoded as static const ints and include that in CallSite.h as well as Statepoint.h. Do you think something like that will be sufficient?

A struct-encapsulated enum or an enum class would also be sufficient. I think any of these choices is a definite step in the right direction.

================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:151
@@ -126,1 +150,3 @@
 
+static bool InlineStatepoint(Statepoint SP, InlineFunctionInfo &IFI,
+                             bool InsertLifetime) {
----------------
It would be good to have a comment describing which classes of statepoints can be inlined, which cannot, if these restrictions can be loosened in the future, and the reasoning behind them.

================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:153
@@ +152,3 @@
+                             bool InsertLifetime) {
+  if (SP.gc_args_begin() != SP.gc_args_begin() ||
+      SP.vm_state_begin() != SP.vm_state_end() ||
----------------
Did you intend `SP.gc_args_begin() != SP.gc_args_end()`?

================
Comment at: test/Transforms/Inline/statepoints-basic.ll:62
@@ +61,3 @@
+define i8 addrspace(1)* @test_no_inline_3(i8 addrspace(1)* %obj) gc "statepoint-example" {
+; Inlining through a statepoint that has deopt arguments is not currenlty supported
+
----------------
s/currenlty/currently

http://reviews.llvm.org/D10758

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list