diff --git a/llvm/include/llvm/CodeGen/Register.h b/llvm/include/llvm/CodeGen/Register.h --- a/llvm/include/llvm/CodeGen/Register.h +++ b/llvm/include/llvm/CodeGen/Register.h @@ -117,12 +117,17 @@ // Provide DenseMapInfo for Register template<> struct DenseMapInfo { - static inline unsigned getEmptyKey() { return ~0U; } - static inline unsigned getTombstoneKey() { return ~0U - 1; } - static unsigned getHashValue(const unsigned& Val) { return Val * 37U; } - - static bool isEqual(const unsigned& LHS, const unsigned& RHS) { - return LHS == RHS; + static inline unsigned getEmptyKey() { + return DenseMapInfo::getEmptyKey(); + } + static inline unsigned getTombstoneKey() { + return DenseMapInfo::getTombstoneKey(); + } + static unsigned getHashValue(const unsigned &Val) { + return DenseMapInfo::getHashValue(Val); + } + static bool isEqual(const unsigned &LHS, const unsigned &RHS) { + return DenseMapInfo::isEqual(LHS, RHS); } }; diff --git a/llvm/include/llvm/MC/MCRegister.h b/llvm/include/llvm/MC/MCRegister.h --- a/llvm/include/llvm/MC/MCRegister.h +++ b/llvm/include/llvm/MC/MCRegister.h @@ -67,12 +67,17 @@ // Provide DenseMapInfo for MCRegister template<> struct DenseMapInfo { - static inline unsigned getEmptyKey() { return ~0U; } - static inline unsigned getTombstoneKey() { return ~0U - 1; } - static unsigned getHashValue(const unsigned& Val) { return Val * 37U; } - - static bool isEqual(const unsigned& LHS, const unsigned& RHS) { - return LHS == RHS; + static inline unsigned getEmptyKey() { + return DenseMapInfo::getEmptyKey(); + } + static inline unsigned getTombstoneKey() { + return DenseMapInfo::getTombstoneKey(); + } + static unsigned getHashValue(const unsigned &Val) { + return DenseMapInfo::getHashValue(Val); + } + static bool isEqual(const unsigned &LHS, const unsigned &RHS) { + return DenseMapInfo::isEqual(LHS, RHS); } }; diff --git a/llvm/lib/Target/Hexagon/BitTracker.cpp b/llvm/lib/Target/Hexagon/BitTracker.cpp --- a/llvm/lib/Target/Hexagon/BitTracker.cpp +++ b/llvm/lib/Target/Hexagon/BitTracker.cpp @@ -340,7 +340,7 @@ return TRI.getRegSizeInBits(VC); } assert(Register::isPhysicalRegister(RR.Reg)); - unsigned PhysR = + Register PhysR = (RR.Sub == 0) ? Register(RR.Reg) : TRI.getSubReg(RR.Reg, RR.Sub); return getPhysRegBitWidth(PhysR); }