[PATCH] D47714: [TableGen][AsmMatcherEmitter] Allow tied operands of different classes in aliases.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 15 07:59:24 PDT 2018
fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.
LGTM, given that it solves the problem as a small extension of tied operand handling. Please wait with committing till next week, in case anyone else has comments or suggestions.
I suppose there is no place where to document this behavior, but could you add a brief comment to regsEqual, stating what it is used for?
================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2162
assert(OpInfo.MINumOperands == 1 && "Not a singular MCOperand");
- unsigned TiedOp = OpInfo.TiedOperands.ResOpnd;
- unsigned SrcOp1 = OpInfo.TiedOperands.SrcOpnd1Idx + HasMnemonicFirst;
- unsigned SrcOp2 = OpInfo.TiedOperands.SrcOpnd2Idx + HasMnemonicFirst;
- assert(i > TiedOp && "Tied operand precedes its target!");
+ unsigned char TiedOp = OpInfo.TiedOperands.ResOpnd;
+ unsigned char SrcOp1 =
----------------
If we are unsigned char here, should we change the type of TiedOperandsEnumMap's key accordingly?
================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2282
+ OS << " /* " << KV.second << " */ { "
+ << utostr((unsigned char)std::get<0>(KV.first)) << ", "
+ << utostr((unsigned char)std::get<1>(KV.first)) << ", "
----------------
Do we need the casts here? The elements in TiedOperandsEnumMap are unsigned already?
https://reviews.llvm.org/D47714
More information about the llvm-commits
mailing list