This is an archive of the discontinued LLVM Phabricator instance.

[Inlining][NFC] Introduce a InlineFunction that takes a Statepoint.
AbandonedPublic

Authored by sanjoy on Jun 22 2015, 7:15 PM.

Details

Summary

After this change, clients of InlineFunction can get it to inline
through calls / invokes wrapped in gc_statepoint. NFC because nothing
actually exercises this code path yet.

Depends on D10631

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 28192.Jun 22 2015, 7:15 PM
sanjoy retitled this revision from to [Inlining][NFC] Introduce a InlineFunction that takes a Statepoint..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added reviewers: reames, chandlerc, nlewycky.
sanjoy added a subscriber: Unknown Object (MLST).
sanjoy updated this revision to Diff 28284.Jun 23 2015, 2:15 PM
  • update with fixed patch
reames edited edge metadata.Jun 24 2015, 11:54 AM

I'm not sure I like the semantic intent to this patch. It seems to imply that the caller needs to know whether a particular call site is a statepoint or not. I think that's a mistake. I would expect the details of inlining through a call site which happens to be a statepoint to be hidden entirely within InlineFunction.

reames requested changes to this revision.Jun 24 2015, 11:54 AM
reames edited edge metadata.
This revision now requires changes to proceed.Jun 24 2015, 11:54 AM

Forgot to say in my previous review, but I think you need to find a way to test this. Used code is not really NFC, it's just unused. I know you're planning on building on this with related patches, but this is big enough it should be tested on it's own.

One suggestion: You could restructure PlaceSafepoints to convert to insert statepoints for gc polls, then inline using the new functionality. Anything that exercises this is fine by me.

sanjoy updated this revision to Diff 28527.Jun 25 2015, 7:13 PM
sanjoy edited edge metadata.
  • have InlineSite dispatch over Statepoint and CallSite using a macro.
  • make the PlaceSafepoints pass use this new functionality in InlineFunction to have a mode where it does not inline the gc.safepoint_poll function by itself, but does it via the AlwaysInliner pass.
sanjoy abandoned this revision.Jun 25 2015, 8:01 PM

I've merged D10633 and D10632 into D10758. Their combined size is not too large IMO, and keeping them together lets me avoid adding unneeded complexity via flags like -spp-dont-pre-inline-polls just for testing.