This is an archive of the discontinued LLVM Phabricator instance.

[globalisel] Tablegen-erate PartialMapping*/ValueMapping*/BankIDToCopyMapIdx.
AbandonedPublic

Authored by dsanders on Dec 6 2016, 8:04 AM.

Details

Summary

Note that the order of register banks in the tables swaps as a result. This has
no effect on behaviour because of the fixes in r288812. Also, a couple fields
are not controllable from the .td files because there's no variety in the
current values (NumBreakDowns of RegisterBankInfo::ValueMapping is always 1,
and StartIdx of RegisterBankInfo::PartialMapping, is always 0).

Depends on D27339

Event Timeline

dsanders updated this revision to Diff 80420.Dec 6 2016, 8:04 AM
dsanders retitled this revision from to [globalisel] Tablegen-erate PartialMapping*/ValueMapping*/BankIDToCopyMapIdx..
dsanders updated this object.
dsanders added reviewers: ab, qcolombet, t.p.northover.
dsanders added a subscriber: llvm-commits.
rovka added inline comments.Dec 7 2016, 8:10 AM
utils/TableGen/RegisterBankEmitter.cpp
372

This function is growing a bit long, could you split it up a bit?

386

These used to start at 1, they will start at 0 now - is this intentional?

390

Bank.hasPartialMappings()?

dsanders added inline comments.Dec 7 2016, 8:44 AM
utils/TableGen/RegisterBankEmitter.cpp
372

Ok.

386

Yes, but it might be better to leave it for a later patch. I've only got a weak argument for either value.

The argument in favour of 0 is that that's what it was before r288812. That commit changed it to 1 to demonstrate that it had caught all the places where it was either using -PMI_FirstGPR (calls FirstGPR at the time) or had forgotten to include a subtraction. Now that this has been fixed, it's getting less important as we tablegen-erate more.

The argument in favour of 1 is that there's still a couple bits that haven't been tablegen-erated yet such as the asserts in AArch64RegisterBankInfo::AArch64RegisterBankInfo().

390

Thanks. I missed this one.

dsanders updated this revision to Diff 81065.Dec 12 2016, 3:32 AM

Update to account for Diana's comments:

  • Split up emitRegisterBankInfoImplementation()
  • Call Bank.hasPartialMappings() instead of repeating its implementation
dsanders marked 4 inline comments as done.Dec 12 2016, 3:34 AM
qcolombet requested changes to this revision.Dec 19 2016, 6:47 PM
qcolombet edited edge metadata.

Hi Daniel,

I think I already mentioned that in another review, but I expect the generation of the mappings to be part of some instruction selector tablegen backend. Indeed a mapping is bound to an instruction, not a register bank. The mappings happen to use register banks but are not derived from them, thus I don't think it makes sense to have their generation in the RegisterBankEmitter.

Cheers,
-Quentin

lib/Target/AArch64/AArch64GenRegisterBankInfo.def
73

Looks like general goodness, commit that part separately.

This revision now requires changes to proceed.Dec 19 2016, 6:47 PM
dsanders abandoned this revision.Feb 9 2017, 2:53 AM

We committed a different patch series instead.