This is an archive of the discontinued LLVM Phabricator instance.

[PM] port Rewrite Statepoints For GC to the new pass manager.
ClosedPublic

Authored by fedor.sergeev on Dec 13 2017, 2:25 AM.

Details

Summary

The port is nearly straightforward.
The only complication is related to the analyses handling,
since one of the analyses used in this module pass is domtree,
which is a function analysis. That requires asking for the results
of each function and disallows a single interface for run-on-module
pass action.

Decided to copy-paste the main body of this pass.
Most of its code is requesting analyses anyway, so not that much
of a copy-paste.

The rest of the code movement is to transform all the implementation
helper functions like stripNonValidData into non-member statics.

Extended all the related LLVM tests with new-pass-manager use.
No failures.

Diff Detail

Repository
rL LLVM

Event Timeline

fedor.sergeev created this revision.Dec 13 2017, 2:25 AM
anna requested changes to this revision.Dec 14 2017, 11:07 AM

comments inline. Changes look almost good to go.

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
2519 ↗(On Diff #126700)

we should assert instead of checking these now. Both versions of runOnModule (old pass and new pass manager versions of RS4GC) check these before calling runOnFunction.

2524 ↗(On Diff #126700)

Pls move these to the runOnModule versions and assert here. We don't want to unnecessarily get the analyses for functions that shouldn't rewrite statepoints.

This is the same behaviour we have before this change. We get the analyses (DT, TTI) after checking for the policy choice above.

This revision now requires changes to proceed.Dec 14 2017, 11:07 AM

addressing @anna's comments

fedor.sergeev marked 2 inline comments as done.

now fully updated

anna accepted this revision.Dec 14 2017, 4:13 PM

lgtm modulo nit

lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
186 ↗(On Diff #127042)

fix indentation?

This revision is now accepted and ready to land.Dec 14 2017, 4:13 PM
This revision was automatically updated to reflect the committed changes.
fedor.sergeev marked an inline comment as done.Dec 15 2017, 9:19 AM