This is an archive of the discontinued LLVM Phabricator instance.

[NFC][mlgo] Add feature declarations for the ML regalloc advisor
ClosedPublic

Authored by mtrofin on Dec 20 2021, 8:52 PM.

Details

Summary

This just adds feature declarations and some boilerplate.

Diff Detail

Event Timeline

mtrofin created this revision.Dec 20 2021, 8:52 PM
mtrofin requested review of this revision.Dec 20 2021, 8:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2021, 8:52 PM
yundiqian added inline comments.Jan 3 2022, 12:06 AM
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
140–145

should this be a common function somewhere?

147

what's the use case for this function? do we just set the value when needed?

mtrofin marked 2 inline comments as done.Jan 4 2022, 8:28 AM
mtrofin added inline comments.
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
147

see the comment on line 136. The template getTotalSize and the macro go hand in hand. The use case (resetting) is specific to regalloc.

It's not impossible to make these APIs of the MLModelRunner, but it'd involve exposing some notion of tensor type to the non-development mode runners, and we don't need that right now elsewhere. I'd prefer to wait and see if there are more usecases like this.

yundiqian accepted this revision.Jan 4 2022, 9:22 AM
This revision is now accepted and ready to land.Jan 4 2022, 9:22 AM
mtrofin updated this revision to Diff 397649.Jan 5 2022, 11:38 AM
mtrofin marked an inline comment as done.

forgot adding 'nr_urgent'

This revision was landed with ongoing or failed builds.Jan 5 2022, 11:54 AM
This revision was automatically updated to reflect the committed changes.