This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Use Register in RegisterPressure APIs
ClosedPublic

Authored by mtrofin on Oct 27 2020, 2:31 PM.

Details

Summary

Some related changes as well.

Diff Detail

Event Timeline

mtrofin created this revision.Oct 27 2020, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 2:31 PM
mtrofin requested review of this revision.Oct 27 2020, 2:31 PM
gjain accepted this revision.Oct 27 2020, 2:40 PM
gjain added inline comments.
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
635

What is the difference of the RegUnit vs Register? Should we rename the names to be just Reg as well?

This revision is now accepted and ready to land.Oct 27 2020, 2:40 PM
mtrofin marked an inline comment as done.Oct 27 2020, 2:45 PM
mtrofin added inline comments.
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
635

Not sure, but I'd decouple that from the strong-typing exercise though.

My understanding is that MCRegister values take a subset [0,2**30). In some cases MCRegister is more suitable than Register. Have you checked whether some places should use MCRegister instead?

mtrofin marked an inline comment as done.Oct 27 2020, 3:48 PM

My understanding is that MCRegister values take a subset [0,2**30). In some cases MCRegister is more suitable than Register. Have you checked whether some places should use MCRegister instead?

Yes - that's part of the focus of these refactorings - i.e. using Register / MCRegister appropriately (instead of unsigned). My approach has been to look at how the value was used. In these cases, it appears the value may be virtual - because there were checks to that extent. Having said that, it is possible there are cases where those checks were themselves redundant (i.e. should / could have been asserts before). Maybe I missed something, I'll take another look.

mtrofin updated this revision to Diff 301174.Oct 27 2020, 9:04 PM

added some missing changes (uses of changed APIs)

This revision was landed with ongoing or failed builds.Oct 28 2020, 12:14 PM
This revision was automatically updated to reflect the committed changes.