This is an archive of the discontinued LLVM Phabricator instance.

[FuncSpec] Cache code metrics for analyzed functions.
ClosedPublic

Authored by labrinea on Mar 31 2022, 7:38 AM.

Details

Summary

This isn't expected to reduce compilation times as max-iters is set to one by default, but it helps with recursive functions that require higher iteration counts.

Diff Detail

Event Timeline

labrinea created this revision.Mar 31 2022, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 7:38 AM
labrinea requested review of this revision.Mar 31 2022, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 7:38 AM
ChuanqiXu accepted this revision.Mar 31 2022, 7:01 PM

LGTM basically. Only suggestions on nit.
And I suggest the title should contain one [NFC] tag.

llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
547–548

The implementation should be right but it didn't implement in the usual style so that readers might be slightly confused at the first sight. I suggest:


The implementation for analyzeFunction might need to be changed slightly too: it need to an assertion to check F is not cached and insert the result to FunctionMetrics.

This revision is now accepted and ready to land.Mar 31 2022, 7:01 PM
This revision was landed with ongoing or failed builds.Apr 1 2022, 2:59 AM
This revision was automatically updated to reflect the committed changes.