[LLVMdev] Tablegen: How to define a Pattern with multiple result instructions

kewuzhang kewu.zhang at amd.com
Fri Aug 15 12:48:18 PDT 2014


tks a lot.

kevin
On Aug 15, 2014, at 3:42 PM, Tom Stellard <tom at stellard.net> wrote:

> On Fri, Aug 15, 2014 at 01:23:53PM -0400, kewuzhang wrote:
>> Dear Tom,
>> 
>> What is the advantage to use  the “pseudo instruction” approach VS “custom lowering/DAGtoDAGSelection”  VS “ Library function”?
>> 
> 
> It really depends on the instructions being lowered.  If you are adding two
> instructions where one has a chain and the other doesn't, it is much easier
> to do it with pseudo instruction lowered using a custom inserter.
> 
> If you want both instruction to be glued together for the duration of
> the program, then you will need to use a pseudo instruction and
> expand it post-RA.
> 
> I've never tried to emit two unrelated instructions from a node with a single
> result using DAGToDAGSelection, but I think it's theoretically possible
> if you tied them together using glue.
> 
> -Tom
> 
>> Best
>> 
>> Kevin
>> 
>> 
>> 
>> On Aug 14, 2014, at 9:27 AM, Tom Stellard <tom at stellard.net> wrote:
>> 
>>> On Thu, Aug 14, 2014 at 12:05:33AM -0700, Arsen Hakobyan wrote:
>>>> Hi all,
>>>> 
>>>> I would like to be sure that Tablegen still does not support completely
>>>> separate multiple instruction generation, and the only way is to write
>>>> costume code (may be in TargetISelDAGToDAG class) to get the needed result.
>>>> 
>>>> Dear Tom, do you found other solution (using Tablegen tool) for this?
>>>> 
>>> 
>>> I think the best way to do this is to use a pseudo instruction and then
>>> expand it after instruction selection by using a custom inserter.
>>> 
>>> -Tom
>>> 
>>>> Thanks,
>>>> Arsen
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context: http://llvm.1065342.n5.nabble.com/Tablegen-How-to-define-a-Pattern-with-multiple-result-instructions-tp44115p71453.html
>>>> Sent from the LLVM - Dev mailing list archive at Nabble.com.
>>>> _______________________________________________
>>>> LLVM Developers mailing list
>>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>> 





More information about the llvm-dev mailing list