[mlir][dxsa] Add control flow instructions#194
Conversation
|
I suppose there is an open question here: do we want structured MLIR? If we do, we wouldn't model e.g. |
No. This is a bytecode dialect. |
- break - continue - default - else - endif - endloop - endswitch - loop - ret Example: dxsa.break dxsa.continue dxsa.default dxsa.else dxsa.endif dxsa.endloop dxsa.endswitch dxsa.loop dxsa.ret Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
…split-input-file` Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
1e72f2f to
0bdc78d
Compare
| // DXSA shared bases for ops with inline operands | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| class DXSA_NullaryOp<string mnemonic> : DXSA_Op<mnemonic> { |
There was a problem hiding this comment.
This name is inconsistent with the above description and below classes. It's used in this PR for ops without inline operands, when the above description says "ops with inline operands". UnaryOp means one source operand, one destination operand. BinaryOp means two source operands, one destination operand. TernaryOp means three source operands, one destination operand. NullaryOp, by extension, would mean zero source operands, one destination operand. But that means it isn't suitable for the instructions you're defining in this PR.
If we merge #201 first, we can avoid the need to create a NullaryOp by making a slight tweak to it to modify PlainOp to make $precise optional, and use PlainOp<"...", 0, 0, 0> or such.
There was a problem hiding this comment.
If we merge #201 first, we can avoid the need to create a
NullaryOpby making a slight tweak to it to modifyPlainOpto make$preciseoptional, and usePlainOp<"...", 0, 0, 0>or such.
As it turns out, we have many zero-argument instructions.
I think it will be still useful to have a synonym for PlainOp<..., 0, 0, 0> for declaring such instructions (in case we decide to replace PlainOp<..., 0, 0, 0> with something else, for some reason). Would it be ok to call it DXSA_ZeroOperandOp, as an alternative for DXSA_NullaryOp or DXSA_ZeroOp?
There was a problem hiding this comment.
Would it be ok to call it
DXSA_ZeroOperandOp, as an alternative forDXSA_NullaryOporDXSA_ZeroOp?
I think it still wouldn't belong here based on "ops with inline operands", but I'm now thinking it may be better to just update that description.
Looking at other instructions not yet covered, we also have instructions with source operands but no destination operands (mostly in #160, which needs updating). How would you feel about DXSA_NullaryOp<string mnemonic, int dsts = 1, bit hasprecise = 1> : DXSA_PlainOp<mnemonic, dsts, 0, hasprecise>;, and likewise for DXSA_UnaryOp, DXSA_BinaryOp, DXSA_TernaryOp ? That way, we can use DXSA_NullaryOp<"break", 0>, DXSA_UnaryOp<"breakc", 0>, etc. ?
Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
- call - callc - case - label - abort - debug_break Example: dxsa.call dxsa.callc dxsa.case dxsa.label dxsa.abort dxsa.debug_break Signed-off-by: Vladimir Shiryaev <vshiryaev@accesssoftek.com>
Example: