I have several places where I want to emit several instructions but they are not
connected as would be required by Pat.
Right now I do them as sort of pseudo instructions where several machine
instructions are put in the assembly string.
This has several problems for direct object emitting and also it's not the
cleanest solution.
I really want to match the pattern and emit my instruction sequence using a set
of single instructions.
This is what is supposedly allowed in class Pattern but I can't seem to get
it to be accepted by tablegen and can't find any examples of people using
it.
An example of a place where I need it is for certain conditional expressions.
For example, register T8 is not directly accessible when in mips 16 mode and is
more or less a condition code register in that mode.
So I want to do a compare and then a branch based on the contents of T8 (which
the branch instructions can implicity see).
I have other cases that are more involved where I am simulating conditional move
instructions.
I can do it all with my current method but it's not preferred and would be
cleaner with this multiple instruction sequence of the Pattern class.
________________________________________
From: Kotler, Reed
Sent: Sunday, September 16, 2012 9:57 AM
To: Triple Yang
Cc: LLVM-Dev [llvmdev at cs.uiuc.edu]
Subject: RE: [LLVMdev] Pattern class
I'm interested in class Pattern.
Classes Pat and ComplexPattern are used everywhere.
________________________________________
From: Triple Yang [triple.yang at gmail.com]
Sent: Sunday, September 16, 2012 9:55 AM
To: Kotler, Reed
Cc: LLVM-Dev [llvmdev at cs.uiuc.edu]
Subject: Re: [LLVMdev] Pattern class
You might want to refer to lib/Target/Sparc/SparcInstrInfo.td for
examples of both Pat and ComplexPattern.
Regards.
2012/9/16 Kotler, Reed <rkotler at mips.com>:> Has anybody used the Pattern class. We all use Pat and ComplexPattern but I
> can't find any examples of Pattern.
>
> I have some instructions that I'm currently treating as pseudos but
I'd like
> to treat them as patterns with several instructions but this does not seem
> to work, at least I can't get it to work so far.
>
> I get an error:
>
> Cannot handle instructions with temporaries yet!
>
> When I try and use it.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
杨勇勇 (Yang Yongyong)