This is an archive of the discontinued LLVM Phabricator instance.

Use MCRegister in MCRegisterInfo's interfaces
ClosedPublic

Authored by dsanders on Aug 1 2019, 1:38 PM.

Details

Summary

As part of this, define DenseMapInfo for MCRegister (and Register while I'm at it)

Depends on D65599

Event Timeline

dsanders created this revision.Aug 1 2019, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2019, 1:38 PM
dsanders updated this revision to Diff 212933.Aug 1 2019, 4:49 PM

Previous patch was based off an earlier attempt at this. Correct it to be based on D65599

arsenm added inline comments.Aug 1 2019, 4:52 PM
llvm/include/llvm/MC/MCRegister.h
72

Why *37?

llvm/lib/Target/Hexagon/BitTracker.cpp
343–344

Result should be Register?

dsanders marked 2 inline comments as done.Aug 1 2019, 4:57 PM
dsanders added inline comments.
llvm/include/llvm/MC/MCRegister.h
72

No idea. It's copied directly from the DenseMapInfo<unsigned> implementation

llvm/lib/Target/Hexagon/BitTracker.cpp
343–344

Sure, I can make that change too. The reason I had to modify this line is because the ? operator couldn't decide whether to cast the third operand from Register to unsigned, or the second from unsigned to Register as both conversions exist

arsenm added inline comments.Aug 1 2019, 5:03 PM
llvm/include/llvm/MC/MCRegister.h
72

Is it possible to implement this by calling the unsigned version?

dsanders updated this revision to Diff 212943.Aug 1 2019, 5:48 PM
  • Implement DenseMapInfo<MCRegister> via DenseMapInfo<unsigned> (and likewise for Register)
  • Nit in Hexagon/BitTracker.cpp
arsenm accepted this revision.Aug 1 2019, 5:52 PM

LGTM

This revision is now accepted and ready to land.Aug 1 2019, 5:52 PM
This revision was automatically updated to reflect the committed changes.