OSDN Git Service

[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)
commitb021f7809f71d596002567323d0a251826f491a0
tree5b7c9f8b946c5386eec28a17ea8f9015f434636f
parent13480b88461fbf7fad2cf08934ba4657ca0fcec0
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362064 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/DAGISelMatcherGen.cpp
utils/TableGen/GlobalISelEmitter.cpp