This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Teach LLVM to inline through statepoints.
AbandonedPublic

Authored by sanjoy on Jun 25 2015, 8:00 PM.

Details

Summary

After this change, LLVM can inline through through some calls / invokes wrapped in gc_statepoint. The cost analysis pass does not currently grok statepoints. We only inline through a gc_statepoint if the call is
marked alwaysinline.

Depends on D10631

Previously was split into D10632 and D10633.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 28531.Jun 25 2015, 8:00 PM
sanjoy retitled this revision from to [Inliner] Teach LLVM to inline through statepoints..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added reviewers: reames, pgavlin, swaroop.sridhar.
sanjoy added a subscriber: Unknown Object (MLST).
sanjoy updated this object.Jun 26 2015, 12:42 AM
pgavlin edited edge metadata.Jun 26 2015, 11:08 AM

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.

include/llvm/IR/CallSite.h
119

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.

lib/Transforms/Utils/InlineFunction.cpp
151

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.

153

Did you intend SP.gc_args_begin() != SP.gc_args_end()?

test/Transforms/Inline/statepoints-basic.ll
63

s/currenlty/currently

sanjoy edited edge metadata.Jul 2 2015, 12:58 PM
sanjoy updated this revision to Diff 28969.Jul 2 2015, 12:58 PM
sanjoy marked 3 inline comments as done.
  • address review

Some comments addressed. I'll fix the "Extract out StatepointOffsets" bit once we've reached consensus on D10631.

Looks good aside from the pending StatepointOffset refactoring and one small comment.

lib/Transforms/Utils/InlineFunction.cpp
151

I'd still like to see some explanation of why the restrictions are there and if they'll be lifted. Doesn't have to be much--even a simple // TODO at the beginning of your existing comment would suffice.

sanjoy abandoned this revision.Sep 10 2015, 11:24 AM

These have been superseded by the operand bundles work.