[LLVMdev] Look-ahead instruction selection
Eli Friedman
eli.friedman at gmail.com
Mon Jan 5 14:55:40 PST 2009
On Mon, Jan 5, 2009 at 2:32 PM, Alex <alex.lavoro.propio at gmail.com> wrote:
> In .td file, if the pattern to match the DAG is:
>
> (vector_shuffle (mul build_vector, build_vector))
>
> is it possible to return 'mul' (SDNode*) instead of returning the first
> 'vector_shuffle'?
>
> It seems to me that the default instruction selector can only return the
> 'root' node of the pattern.
The simplest thing to do is to map a vector_shuffle to another
vector_shuffle; there shouldn't be any issues with that, I think. Is
there some reason you don't want to write it that way?
Note that you can use a custom PatFrag to match an instruction with a
single use... see, for example, "and_su" in X86InstrInfo.td.
-Eli
More information about the llvm-dev
mailing list