This is an archive of the discontinued LLVM Phabricator instance.

[CodeGenPrepare] Implement releaseMemory
ClosedPublic

Authored by svenvh on Jun 9 2023, 9:29 AM.

Details

Summary

Release BlockFrequencyInfo and BranchProbabilityInfo results,
and other per function information
immediately afterwards, instead of holding onto the memory until the
next CodeGenPrepare::runOnFunction call.

Co-authored-by: Erik Hogeman <erik.hogeman@arm.com>

Diff Detail

Event Timeline

svenvh created this revision.Jun 9 2023, 9:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 9:29 AM
svenvh requested review of this revision.Jun 9 2023, 9:29 AM
arsenm added a subscriber: arsenm.Jun 9 2023, 9:31 AM
arsenm added inline comments.
llvm/lib/CodeGen/CodeGenPrepare.cpp
383

There are a few other maps, do those need to be cleared as well?

svenvh added inline comments.Jun 9 2023, 9:43 AM
llvm/lib/CodeGen/CodeGenPrepare.cpp
383

I was wondering about those too. They weren't problematic for my use case, but if you think it's worth I can move the various clear()s into releaseMemory too.

svenvh updated this revision to Diff 532150.Jun 16 2023, 8:04 AM
svenvh edited the summary of this revision. (Show Details)
svenvh added a reviewer: arsenm.

Also clear some members that were cleared at the start of runOnFunction.

arsenm accepted this revision.Jun 22 2023, 9:50 AM
This revision is now accepted and ready to land.Jun 22 2023, 9:50 AM
This revision was automatically updated to reflect the committed changes.