[PATCH] D42293: [TableGen][AsmMatcherEmitter] Fix tied-constraint checking for InstAliases

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 07:44:46 PST 2018


olista01 added a comment.

I was looking at your original version of this the other day to work out if it could be used to do 3-operand aliases of 2-operand Thumb1 instructions, and this (adding support for aliases) looks like it's what we would need for that.

Why do you need to modify the conversion to MCInst? There is still a parsed operand for every MCInst operand, so can the existing conversion function not handle this already?

Thinking about how to integrate this with the new diagnostics used in the ARM assembler, I think it might be better to check tied operands at the same time as we check the operand classes. In fact, the tied-operand check might be able to replace the operand class check.



================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:3669
   if (!ReportMultipleNearMisses) {
-    OS << "      SMLoc Loc;\n";
-    OS << "      if (!checkAsmTiedOperandConstraints(Inst, Operands, Loc)) {\n";
-    OS << "        ErrorInfo = " << (HasMnemonicFirst ? "1" : "SIndex") << ";\n";
+    OS << "      if (!checkAsmTiedOperandConstraints(it->ConvertFn, Operands, ErrorInfo))\n";
     OS << "        return Match_InvalidTiedOperand;\n";
----------------
If we are in a ReportMultipleNearMisses backend then this check will be skipped, so should we assert here?


https://reviews.llvm.org/D42293





More information about the llvm-commits mailing list