[TableGen] Don't try to move CheckOpcode before CheckType/CheckChildType in ContractNodes. NFC

It appears that CheckOpcode is already emitted before CheckType so
this hasn't been doing anything on any in tree targets.
This commit is contained in:
Craig Topper 2025-02-04 21:16:04 -08:00
parent 79762a10e4
commit 31bd82cdcc

View File

@ -135,13 +135,11 @@ static void ContractNodes(std::unique_ptr<Matcher> &MatcherPtr,
// variants. // variants.
} }
// If we have a CheckType/CheckChildType/Record node followed by a // If we have a Record node followed by a CheckOpcode, invert the two nodes.
// CheckOpcode, invert the two nodes. We prefer to do structural checks // We prefer to do structural checks before type checks, as this opens
// before type checks, as this opens opportunities for factoring on targets // opportunities for factoring on targets like X86 where many operations are
// like X86 where many operations are valid on multiple types. // valid on multiple types.
if ((isa<CheckTypeMatcher>(N) || isa<CheckChildTypeMatcher>(N) || if (isa<RecordMatcher>(N) && isa<CheckOpcodeMatcher>(N->getNext())) {
isa<RecordMatcher>(N)) &&
isa<CheckOpcodeMatcher>(N->getNext())) {
// Unlink the two nodes from the list. // Unlink the two nodes from the list.
Matcher *CheckType = MatcherPtr.release(); Matcher *CheckType = MatcherPtr.release();
Matcher *CheckOpcode = CheckType->takeNext(); Matcher *CheckOpcode = CheckType->takeNext();