This is an archive of the discontinued LLVM Phabricator instance.

[nfc][codegen] Move RegisterBank[Info].cpp under CodeGen
ClosedPublic

Authored by mtrofin on Feb 4 2022, 8:40 PM.

Details

Summary

Layering-wise, it seems RegisterBank stuff fits under CodeGen, like
other target abstraction.
In particular, TargetSubtargetInfo has a getRegBankInfo member, but
using that object requires making sure GlobalISel is linked, which is
not always the case (e.g. llvm-jitlink doesn't).

Diff Detail

Event Timeline

mtrofin created this revision.Feb 4 2022, 8:40 PM
mtrofin requested review of this revision.Feb 4 2022, 8:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 8:40 PM

If this change is actually OK/desirable, I can move the .h files over, too, and fix-up the includes. There are ~20 or so occurrences, so maybe I can do that in a subsequent patch (probably also see which are used, too)

gentle reminder - thanks!

myhsu added a subscriber: myhsu.Feb 15 2022, 10:04 AM

Just want to double check: You have a (possibly downstream) use case that wants to leverage RegisterBank without linking GlobalISel, is that correct?
My two-cent is that since none of the upstream code uses RegisterBank outside GlobalISel context, I don't see much justification on making this change. That said, if this situation changes in the upstream in the future (i.e. some other components also use RegisterBank) moving to CodeGen might be a way.

Just want to double check: You have a (possibly downstream) use case that wants to leverage RegisterBank without linking GlobalISel, is that correct?

Yes, a subsequent change would do that: add bank-ness info as a feature to the ML eviction advisor.

My two-cent is that since none of the upstream code uses RegisterBank outside GlobalISel context, I don't see much justification on making this change. That said, if this situation changes in the upstream in the future (i.e. some other components also use RegisterBank) moving to CodeGen might be a way.

It could help others, too, hence wanted to introduce this "for its own merit" - i.e. the justification being cleanup (architectural, in this case).

qcolombet accepted this revision.Feb 15 2022, 11:11 AM
This revision is now accepted and ready to land.Feb 15 2022, 11:11 AM
This revision was landed with ongoing or failed builds.Feb 15 2022, 11:27 AM
This revision was automatically updated to reflect the committed changes.