This is an archive of the discontinued LLVM Phabricator instance.

[Polly] [ScopInliner] [WIP] Teach ScopInliner to inline not-fully-scop'd functions.
Needs ReviewPublic

Authored by bollu on Aug 17 2017, 4:44 PM.

Details

Summary

Relax the constraints that ScopInliner looks for. Also allow it to pick up
functions whose *unique child* of the entry block is a Scop.

TODO: Look into why this crashes on COSMO.

Event Timeline

bollu created this revision.Aug 17 2017, 4:44 PM
bollu updated this revision to Diff 112165.Aug 22 2017, 6:31 AM
  • Use LegacyInlinerBase as the starting point for our inliner pass.
  • Cache inlining results because polyhedral analysis is expensive.
bollu updated this revision to Diff 112168.Aug 22 2017, 6:42 AM
  • [Diff fix] Upload correct arc diff.
bollu added inline comments.Aug 22 2017, 6:44 AM
lib/Transform/ScopInliner.cpp
90

Not sure what polly convention is on this: I create a lambda and immediately evaluate it so I can mark the outer variable as const. It's a nice way to split off coherent sub-checks IMO.

97

Same immediately-invoke-lambda pattern used here.

singam-sanjay added inline comments.Aug 22 2017, 7:05 AM
lib/Transform/ScopInliner.cpp
89

"Whether a child of the top-level region contains a SCoP" ?

92

You're just checking for one of the children of the TopLevelRegion to be a SCoP ? How is it fine for one of the children to not be a SCoP ?

philip.pfaffe edited edge metadata.Sep 11 2017, 3:46 AM

As far as I can tell, you're only looking at ValidRegions here, thus you are ignoring second-to-top-level regions that are not scoppable. What if those regions have sideeffects?

jdoerfert resigned from this revision.Jun 4 2019, 10:03 PM