kewuzhang
2014-Aug-15 17:23 UTC
[LLVMdev] Tablegen: How to define a Pattern with multiple result instructions
Dear Tom, What is the advantage to use the “pseudo instruction” approach VS “custom lowering/DAGtoDAGSelection” VS “ Library function”? 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
Tom Stellard
2014-Aug-15 19:42 UTC
[LLVMdev] Tablegen: How to define a Pattern with multiple result instructions
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 >
kewuzhang
2014-Aug-15 19:48 UTC
[LLVMdev] Tablegen: How to define a Pattern with multiple result instructions
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 >>