[PATCH] D65605: Use MCRegister in MCRegisterInfo's interfaces

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 16:58:33 PDT 2019


dsanders marked 2 inline comments as done.
dsanders added inline comments.


================
Comment at: llvm/include/llvm/MC/MCRegister.h:72
+  static inline unsigned getTombstoneKey() { return ~0U - 1; }
+  static unsigned getHashValue(const unsigned& Val) { return Val * 37U; }
+
----------------
arsenm wrote:
> Why *37?
No idea. It's copied directly from the DenseMapInfo<unsigned> implementation


================
Comment at: llvm/lib/Target/Hexagon/BitTracker.cpp:343
   assert(Register::isPhysicalRegister(RR.Reg));
-  unsigned PhysR = (RR.Sub == 0) ? RR.Reg : TRI.getSubReg(RR.Reg, RR.Sub);
+  unsigned PhysR =
+      (RR.Sub == 0) ? Register(RR.Reg) : TRI.getSubReg(RR.Reg, RR.Sub);
----------------
arsenm wrote:
> Result should be Register?
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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65605/new/

https://reviews.llvm.org/D65605





More information about the llvm-commits mailing list