diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 6e8e832763e7..d98fc185e5fb 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -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(getLeafValue())) { if (DefInit *NDI = dyn_cast(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() ||