[TableGen] New default operand "undef_tied_input"
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 30 May 2019 07:30:37 +0000 (07:30 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 30 May 2019 07:30:37 +0000 (07:30 +0000)
commitde234847e9dbc26d8b3377871fde3943c6fb309f
tree6c34cc4f8a7e8975d87716714377d0d005d1c38b
parentf04b3635c40e76e525f47807f64fdbe0a9fdf4ba
[TableGen] New default operand "undef_tied_input"

This is a new special identifier which you can use as a default in
OperandWithDefaultOps. The idea is that you use it for an input
operand of an instruction that's tied to an output operand, and its
semantics are that (in the default case) the input operand's value is
not used at all.

The detailed effect is that when instruction selection emits the
instruction in the form of a pre-regalloc MachineInstr, it creates an
IMPLICIT_DEF node to use as that input.

If you're creating an MCInst with explicit register names, then the
right handling would be to set the input operand to the same register
as the output one (honouring the tie) and to add the 'undef' flag
indicating that that register is deemed to acquire a new don't-care
definition just before we read it. But I haven't done that in this
commit, because there was no need to - no Tablegen backend seems to
autogenerate default fields in an MCInst.

Patch by: Simon Tatham

Differential Revision: https://reviews.llvm.org/D60696

llvm-svn: 362064
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
llvm/utils/TableGen/DAGISelMatcherGen.cpp
llvm/utils/TableGen/GlobalISelEmitter.cpp