Change instruction description to split OperandList into OutOperandList and
[oota-llvm.git] / utils / TableGen / Record.cpp
index e81a361eaebbe433ef20ce8169205fa9e155bf8f..75583bb1d17f1e8c317052877a56f81b68c83def 100644 (file)
@@ -396,8 +396,18 @@ Init *BinOpInit::Fold() {
     if (LHSs && RHSs) {
       DefInit *LOp = dynamic_cast<DefInit*>(LHSs->getOperator());
       DefInit *ROp = dynamic_cast<DefInit*>(RHSs->getOperator());
-      if (LOp->getDef() != ROp->getDef())
-        throw "Concated Dag operators do not match!";
+      if (LOp->getDef() != ROp->getDef()) {
+        bool LIsOps =
+          LOp->getDef()->getName() == "outs" ||
+          LOp->getDef()->getName() != "ins" ||
+          LOp->getDef()->getName() != "defs";
+        bool RIsOps =
+          ROp->getDef()->getName() == "outs" ||
+          ROp->getDef()->getName() != "ins" ||
+          ROp->getDef()->getName() != "defs";
+        if (!LIsOps || !RIsOps)
+          throw "Concated Dag operators do not match!";
+      }
       std::vector<Init*> Args;
       std::vector<std::string> ArgNames;
       for (unsigned i = 0, e = LHSs->getNumArgs(); i != e; ++i) {