forked from OSchip/llvm-project
[TableGen] TreePatternNode::isIsomorphicTo - early out for matching leafs. NFCI.
If the leafs are the same then no need to perform DefInit matching.
This commit is contained in:
parent
73635adb86
commit
632668c1c0
|
@ -1946,6 +1946,8 @@ bool TreePatternNode::isIsomorphicTo(const TreePatternNode *N,
|
|||
return false;
|
||||
|
||||
if (isLeaf()) {
|
||||
if (getLeafValue() == N->getLeafValue())
|
||||
return true;
|
||||
if (DefInit *DI = dyn_cast<DefInit>(getLeafValue())) {
|
||||
if (DefInit *NDI = dyn_cast<DefInit>(N->getLeafValue())) {
|
||||
return ((DI->getDef() == NDI->getDef())
|
||||
|
@ -1953,7 +1955,7 @@ bool TreePatternNode::isIsomorphicTo(const TreePatternNode *N,
|
|||
|| getName() == N->getName()));
|
||||
}
|
||||
}
|
||||
return getLeafValue() == N->getLeafValue();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (N->getOperator() != getOperator() ||
|
||||
|
|
Loading…
Reference in New Issue