Skip to content

Commit 31bd82c

Browse files
committed
[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.
1 parent 79762a1 commit 31bd82c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/utils/TableGen/DAGISelMatcherOpt.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,11 @@ static void ContractNodes(std::unique_ptr<Matcher> &MatcherPtr,
135135
// variants.
136136
}
137137

138-
// If we have a CheckType/CheckChildType/Record node followed by a
139-
// CheckOpcode, invert the two nodes. We prefer to do structural checks
140-
// before type checks, as this opens opportunities for factoring on targets
141-
// like X86 where many operations are valid on multiple types.
142-
if ((isa<CheckTypeMatcher>(N) || isa<CheckChildTypeMatcher>(N) ||
143-
isa<RecordMatcher>(N)) &&
144-
isa<CheckOpcodeMatcher>(N->getNext())) {
138+
// If we have a Record node followed by a CheckOpcode, invert the two nodes.
139+
// We prefer to do structural checks before type checks, as this opens
140+
// opportunities for factoring on targets like X86 where many operations are
141+
// valid on multiple types.
142+
if (isa<RecordMatcher>(N) && isa<CheckOpcodeMatcher>(N->getNext())) {
145143
// Unlink the two nodes from the list.
146144
Matcher *CheckType = MatcherPtr.release();
147145
Matcher *CheckOpcode = CheckType->takeNext();

0 commit comments

Comments
 (0)