diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index df8e5e98ac6..0ebfbc564b3 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -42,10 +42,10 @@ namespace llvm { struct MaskRolPair { unsigned Mask; uint8_t RotateLeft; - bool operator==(const MaskRolPair Other) { + bool operator==(const MaskRolPair Other) const { return Mask == Other.Mask && RotateLeft == Other.RotateLeft; } - bool operator!=(const MaskRolPair Other) { + bool operator!=(const MaskRolPair Other) const { return Mask != Other.Mask || RotateLeft != Other.RotateLeft; } }; diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp index 0e9cbeb439f..10b23dcc17a 100644 --- a/utils/TableGen/RegisterInfoEmitter.cpp +++ b/utils/TableGen/RegisterInfoEmitter.cpp @@ -716,16 +716,7 @@ RegisterInfoEmitter::emitComposeSubRegIndexLaneMask(raw_ostream &OS, for (size_t s = 0, se = Sequences.size(); s != se; ++s, SIdx = NextSIdx) { SmallVectorImpl &Sequence = Sequences[s]; NextSIdx = SIdx + Sequence.size() + 1; - if (Sequence.size() != IdxSequence.size()) - continue; - bool Identical = true; - for (size_t o = 0, oe = Sequence.size(); o != oe; ++o) { - if (Sequence[o] != IdxSequence[o]) { - Identical = false; - break; - } - } - if (Identical) { + if (Sequence == IdxSequence) { Found = SIdx; break; }