This is an archive of the discontinued LLVM Phabricator instance.

[globalisel][aarch64] Replace magic numbers with corresponding enumerators in ValMappings. NFC
ClosedPublic

Authored by dsanders on Dec 2 2016, 4:10 AM.

Event Timeline

dsanders updated this revision to Diff 80052.Dec 2 2016, 4:10 AM
dsanders retitled this revision from to [globalisel][aarch64] Replace magic numbers with corresponding enumerators in ValMappings. NFC.
dsanders updated this object.
dsanders added reviewers: ab, qcolombet, t.p.northover.
dsanders added a subscriber: llvm-commits.
qcolombet accepted this revision.Dec 2 2016, 11:01 AM
qcolombet edited edge metadata.

LGTM modulo minor nitpicks.

lib/Target/AArch64/AArch64GenRegisterBankInfo.def
30

I'd use a shorter name: MinIdx or FirstIdx

79–80

Could you clang-format those lines?

This revision is now accepted and ready to land.Dec 2 2016, 11:01 AM
dsanders added inline comments.Dec 5 2016, 3:43 AM
lib/Target/AArch64/AArch64GenRegisterBankInfo.def
30

I was concerned about polluting the llvm::AArch64 namespace with generic-sounding identifiers. Looking at it again, this enum isn't in line with the coding standards (enumerators should have a common prefix) and fixing that would fix this problem. I think we should prefix them all with 'PMI_' to get:

PMI_None,
PMI_GPR32,
...
PMI_LastFPR = PMI_FPR512,
PMI_Min = PMI_FirstGPR

Is that ok with you?

79–80

Ok.

dsanders updated this revision to Diff 80411.Dec 6 2016, 5:57 AM
dsanders edited edge metadata.

Rebase and fix nits

dsanders closed this revision.Dec 6 2016, 6:05 AM