[LLVMdev] X86 LowerVECTOR_SHUFFLE Question

David A. Greene greened at obbligato.org
Mon Feb 28 06:45:42 PST 2011


Bob Wilson <bob.wilson at apple.com> writes:

> It is inefficient and error-prone to recognize legal shuffles and then
> have isel repeat the process.  For example, if the DAG combiner
> changes a shuffle in between legalization and isel, it may stop being
> legal and break isel.  By legalizing to target-specific DAG nodes, we
> avoid that possibility and also make it much easier to match the
> shuffles during isel.

Why is DAG combiner creating illegal nodes after legalization?  It runs
in various modes.  If it creates such a node, it's a bug I think.

Doing the matching this way means that we have to duplicate patterns
and/or we lose opportunities for further pattern matching (multiple
shuffles, etc.).  Is it really worth the maintenance cost?  The isel
matcher has to look over the tree either way.  What exactly is the
inefficiency cost?

In the experience I just had, it is quite error-prone to have multiple
tblgen patterns to match these things.  The way things were before,
there was a clean separation between checking/enforcing node legality
and doing the final code selection, with isel being automatic through
tblgen.  That was nice.  The current setup mixes the two and seems to
result in more code in the form of additional tblgen patterns.  We also
lose the ability to do shuffle peeps or any other such things unless we
teach the code about every type of special target node.

It really doesn't seem worth it to me.

                                -Dave



More information about the llvm-dev mailing list