This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Turn lambda into static function. NFC.
ClosedPublic

Authored by dantrushin on Nov 29 2022, 4:32 AM.

Details

Summary

Extract rematerializeChain() lambda into static function.
We'll need it in upcoming patch to RS4GC pass.
There is small interface change: now reversal of ChainToBase is
performed within this function, not outside.
Still this is non-functional change.

Diff Detail

Event Timeline

dantrushin created this revision.Nov 29 2022, 4:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2022, 4:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
dantrushin requested review of this revision.Nov 29 2022, 4:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2022, 4:32 AM
dantrushin updated this revision to Diff 481665.Dec 9 2022, 8:47 AM

Rebase on tip

If I read it correctly the only change you did while copying is handling reverse order. So lgtm.

You can consider split it into two NFC parts. The first one is handling reverse, the second one is just extract. It would be a bit easier to review.

BTW, now with you change, do we really need to copy Record.ChainToBase to ChainToBase?

BTW, now with you change, do we really need to copy Record.ChainToBase to ChainToBase?

We don't. I'll update patch.

Get rid of temporary ChainToBase vector as suggested in review.

LGTM.

llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
2502

dot at the end.

skatkov accepted this revision.Dec 12 2022, 8:18 PM
This revision is now accepted and ready to land.Dec 12 2022, 8:18 PM
This revision was landed with ongoing or failed builds.Dec 13 2022, 1:15 AM
This revision was automatically updated to reflect the committed changes.