This is an archive of the discontinued LLVM Phabricator instance.

[globalisel][aarch64] Make getCopyMapping() take register banks ID's rather than IsGPR booleans
ClosedPublic

Authored by dsanders on Dec 2 2016, 5:35 AM.

Event Timeline

dsanders updated this revision to Diff 80060.Dec 2 2016, 5:35 AM
dsanders retitled this revision from to [globalisel][aarch64] Make getCopyMapping() take register banks ID's rather than IsGPR booleans.
dsanders updated this object.
dsanders added reviewers: ab, qcolombet, t.p.northover.
dsanders added a subscriber: llvm-commits.
dsanders updated this revision to Diff 80418.Dec 6 2016, 7:24 AM

Rebase following changes to the previous patches

rovka added inline comments.Dec 7 2016, 6:22 AM
lib/Target/AArch64/AArch64GenRegisterBankInfo.def
147

Why is this last member needed? Isn't it invalid to access it in the first place?

150–151

You should update the comment.

dsanders updated this revision to Diff 80596.Dec 7 2016, 7:43 AM

Update comment.
Remove redundant element from BankIDToCopyMapIdx

dsanders marked 2 inline comments as done.Dec 7 2016, 7:44 AM

Thanks. I've updated the patch

lib/Target/AArch64/AArch64GenRegisterBankInfo.def
147

This is a leftover from before I had the assertions on line 158-159. I'll remove it

rovka accepted this revision.Dec 7 2016, 8:24 AM
rovka added a reviewer: rovka.

Cool, LGTM.

This revision is now accepted and ready to land.Dec 7 2016, 8:24 AM
dsanders updated this revision to Diff 82085.Dec 20 2016, 3:25 AM
dsanders marked an inline comment as done.
dsanders edited edge metadata.

Moved this patch to the new patch series.

qcolombet edited edge metadata.Dec 20 2016, 11:37 AM

Hi Daniel,

I fail to see the goal of this patch.
It does not enable new capabilities nor simplify things.
What am I missing?

Cheers,
-Quentin

Hi Daniel,

I fail to see the goal of this patch.
It does not enable new capabilities nor simplify things.
What am I missing?

Cheers,
-Quentin

The aim is to generalize getCopyMapping() so it can support more than two register banks. This will be useful for targets that have special purpose register banks (e.g. the HI/LO registers used by MIPS's multiply and divide and DSP operations, also the co-processor registers), or separate address and data register banks. It should also be useful if AArch64 ever needs to move values between CCR and GPR banks. Later on, I would expect the underlying data tablegen-erated and for getCopyMapping() to be moved to target independent code.

A less important reason (but the one that drew my attention), was that I didn't like the way CHECK_VALUEMAP_CROSSREGCPY() and getCopyMapping() together were converting PartialMappingIdx's to booleans and then back to PartialMappingIdx's and this also caused some problems with my original patch series (CCR needed to be excluded from the copy mapping table).

dsanders updated this revision to Diff 83608.Jan 9 2017, 4:03 AM
dsanders edited edge metadata.

Rebased onto new D27978

dsanders updated this revision to Diff 84279.Jan 13 2017, 4:21 AM

Refresh before commit.

dsanders closed this revision.Jan 13 2017, 6:27 AM