This is an archive of the discontinued LLVM Phabricator instance.

[globalisel] Initialize RegisterBanks with static data. Part 2 of 2.
ClosedPublic

Authored by dsanders on Dec 15 2016, 7:38 AM.

Details

Summary

This patch removes the now-unused addRegBankCoverage() and moves the
remaining static data the setRegBankData() call.

Depends on D27807

Event Timeline

dsanders updated this revision to Diff 81580.Dec 15 2016, 7:38 AM
dsanders retitled this revision from to [globalisel] Initialize RegisterBanks with static data. Part 2 of 2..
dsanders updated this object.
dsanders added reviewers: qcolombet, t.p.northover, ab, rovka.
dsanders added a subscriber: llvm-commits.
rovka accepted this revision.Dec 16 2016, 3:56 AM
rovka edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 16 2016, 3:56 AM
qcolombet requested changes to this revision.Dec 19 2016, 5:37 PM
qcolombet edited edge metadata.
qcolombet added inline comments.
include/llvm/CodeGen/GlobalISel/RegisterBank.h
36 ↗(On Diff #81580)

I would directly give access to the field instead of having an intermediate structure.
Just add a comment that those shouldn't be touched because they are tablegen'ed.

At the same time, we would eliminate the default constructor and the friend relationship with the RegisterBankInfo.
Have a look to TargetRegisterClass.

This revision now requires changes to proceed.Dec 19 2016, 5:37 PM
dsanders added inline comments.Dec 20 2016, 1:52 AM
include/llvm/CodeGen/GlobalISel/RegisterBank.h
36 ↗(On Diff #81580)

I would directly give access to the field instead of having an intermediate structure.
Just add a comment that those shouldn't be touched because they are tablegen'ed.

Let's discuss this on D27807 since the outcome of that determines what we do here.

At the same time, we would eliminate the default constructor

D27809 does this.

and the friend relationship with the RegisterBankInfo.

I haven't checked whether this can be done yet. I'll take a look

dsanders updated this revision to Diff 82070.Dec 20 2016, 1:59 AM
dsanders edited edge metadata.

Rebase and add support for ARM (this patch would otherwise have broken ARM).

dsanders updated this revision to Diff 83600.Jan 9 2017, 2:30 AM
dsanders edited edge metadata.

Rebased onto the updated D27807

As with D27807, RegisterBank::DataTy has been removed it has been moved towards
the TargetRegisterClass initialization style.

dsanders updated this object.Jan 9 2017, 2:34 AM
dsanders added a subscriber: aditya_nandakumar.
qcolombet accepted this revision.Jan 9 2017, 2:27 PM
qcolombet edited edge metadata.

Hi Daniel,

LGTM but squash it with the other part of this patch.

Cheers,
-Quentin

include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
400

Rename in createRegisterBank and merge the comment form the different methods.

lib/Target/AArch64/AArch64GenRegisterBankInfo.def
21

I would squash this part with the tablgen patch.

This revision is now accepted and ready to land.Jan 9 2017, 2:27 PM

Hi Daniel,

LGTM but squash it with the other part of this patch.

Cheers,
-Quentin

Ok, I'll merge this with D27807

include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
400

Ok

lib/Target/AArch64/AArch64GenRegisterBankInfo.def
21

I'd prefer to commit them in sequence to reach the same state (as per our discussion on D27807) if that's ok. Squashing the addition of this array into the last patch in the series will require me to squash an additional 5 patches too since they each depend on the previous one.

qcolombet added inline comments.Jan 10 2017, 9:02 AM
lib/Target/AArch64/AArch64GenRegisterBankInfo.def
21

Ok.

dsanders updated this revision to Diff 84119.Jan 12 2017, 7:11 AM
dsanders edited edge metadata.

Refresh before commit

dsanders closed this revision.Jan 12 2017, 7:55 AM

Squashed with D27807 in rL291768