Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.255 -> 1.256 --- Log message: Relax this check. --- Diffs of the changes: (+10 -7) DAGISelEmitter.cpp | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.255 llvm/utils/TableGen/DAGISelEmitter.cpp:1.256 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.255 Sun Sep 10 21:24:43 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Thu Sep 14 18:54:24 2006 @@ -824,13 +824,16 @@ const SDNodeInfo &NodeInfo = ISE.getSDNodeInfo(getOperator()); if (NodeInfo.hasProperty(SDNodeInfo::SDNPCommutative)) { // Scan all of the operands of the node and make sure that only the last one - // is a constant node. - for (unsigned i = 0, e = getNumChildren()-1; i != e; ++i) - if (!getChild(i)->isLeaf() && - getChild(i)->getOperator()->getName() == "imm") { - Reason = "Immediate value must be on the RHS of commutative operators!"; - return false; - } + // is a constant node, unless the RHS also is. + if (getChild(getNumChildren()-1)->isLeaf() || + getChild(getNumChildren()-1)->getOperator()->getName() != "imm") { + for (unsigned i = 0, e = getNumChildren()-1; i != e; ++i) + if (!getChild(i)->isLeaf() && + getChild(i)->getOperator()->getName() == "imm") { + Reason = "Immediate value must be on the RHS of commutative operators!"; + return false; + } + } } return true; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits