Skip to content

[TableGen] Avoid repeated hash lookups (NFC) #123161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,8 @@ unsigned RuleMatcher::getInsnVarID(InstructionMatcher &InsnMatcher) const {
}

void RuleMatcher::defineOperand(StringRef SymbolicName, OperandMatcher &OM) {
if (!DefinedOperands.contains(SymbolicName)) {
DefinedOperands[SymbolicName] = &OM;
if (DefinedOperands.try_emplace(SymbolicName, &OM).second)
return;
}

// If the operand is already defined, then we must ensure both references in
// the matcher have the exact same node.
Expand All @@ -889,8 +887,7 @@ void RuleMatcher::defineOperand(StringRef SymbolicName, OperandMatcher &OM) {
}

void RuleMatcher::definePhysRegOperand(const Record *Reg, OperandMatcher &OM) {
if (!PhysRegOperands.contains(Reg))
PhysRegOperands[Reg] = &OM;
PhysRegOperands.try_emplace(Reg, &OM);
}

InstructionMatcher &
Expand Down
Loading