Tablegen patterns for instrucion selection can generate multiple
instructions, but only if there is a data dependency between them so
that they can be expressed as a DAG. For example, something like:
(store (load %src), %dst)
For some patterns, we might want to generate a sequence of instructions
which do not have a data dependency. For example on AArch64 some atomic
instructions are implemented like this:
LDP %ptr DMB ISH
Currently, sequences like this can not be selected with tablegen
patterns. To work around this we need to do custom selection, which has
several disadvantages compared to using patterns, such as needing
separate implementations for SelectionDAG and GlobalISel.
This patch adds basic support for tablegen Patterns which have a list
of output instructions. Pattern already has the ability to express this
but it looks like it was never implemented.
Multiple result instructions in an output pattern will be chained
together.
The GlobalISel pattern importer will skip these patterns for now. I
intend to implement this soon.
There are still some problems processing existing patterns for a few
backends. I am looking into these but don't expect them to require
major changes, and I would like feedback on the general approach of
this patch in the meantime.
const std::vector<TreePatternNodePtr> &