[PATCH] D18242: [TableGen] AsmMatcher: support for default values for optional operands

Sam Kolton via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 05:28:37 PDT 2016


SamWot added a comment.

In http://reviews.llvm.org/D18242#384742, @ab wrote:

> I haven't looked closely yet, but have you considered doing this entirely in tablegen, either via default operand lists (like ARM's OptionalDefOperand) or even some default value string?


I actualy thought about this but decided that DefaultMethod is better (at least for now) because usage of OptionalDefOperand or default string value would require big changes in MCTargetAsmParser’s interface and all back-ends. MCTargetAsmParser need some way to create arguments (MCParsedAsmOperand) with default values and insert them in instructions. Currently MCTargetAsmParser has no interface to create operands and it’s hard to create it because every target’s MCParsedAsmOperand implementation differs a lot. With DefaultMethod responsibility to create default arguments lies on back-end developers and no interface changes in MCTargetAsmParser required.

Another solution can be that MCTargetAsmParser would directly create MCOperands instead of MCParsedAsmOperand. But in this case it is there is no way to use RenderMethod for this operand.


http://reviews.llvm.org/D18242





More information about the llvm-commits mailing list