llvm.org GIT mirror llvm / bcf03bb
[TableGen] Use StringRef::compare instead of != and <. NFC. The previous code would always do 1 or 2 prefix compares; explicitly only do one. This speeds up debug -gen-asm-matcher by ~10% (e.g. X86: 40s -> 35s). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273583 91177308-0d34-0410-b5e6-96231b3b80d8 Ahmed Bougacha 4 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
578578 /// operator< - Compare two matchables.
579579 bool operator<(const MatchableInfo &RHS) const {
580580 // The primary comparator is the instruction mnemonic.
581 if (Mnemonic != RHS.Mnemonic)
582 return Mnemonic < RHS.Mnemonic;
581 if (int Cmp = Mnemonic.compare(RHS.Mnemonic))
582 return Cmp == -1;
583583
584584 if (AsmOperands.size() != RHS.AsmOperands.size())
585585 return AsmOperands.size() < RHS.AsmOperands.size();