Haishan
2014-Jun-23 15:07 UTC
[LLVMdev] How to add a MVT::Glue property of intrinsic node?
Hi, I have implemented a pair intrinsic nodes in back-end, But there is a chain dependence between two intrinsic nodes. So in the Pre-RA-sched stage, these two intrinsic nodes would be apart. I expect that there is no node between these two intrinsic nodes, therefore, I guess it would be work if there is a MVT::Glue between these nodes. But I don’t know how to add. Thanks in advance. Haishan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140623/5cea9454/attachment.html>
Tim Northover
2014-Jun-23 15:20 UTC
[LLVMdev] How to add a MVT::Glue property of intrinsic node?
Hi Haishan, On 23 June 2014 16:07, Haishan <hndxvon at 163.com> wrote:> I have implemented a pair intrinsic nodes in back-end, But there is a > chain dependence between two intrinsic nodes. So in the Pre-RA-sched stage, > these two intrinsic nodes would be apart. I expect that there is no node > between these two intrinsic nodes, therefore, I guess it would be work if > there is a MVT::Glue between these nodes. But I don’t know how to add.You can't Glue the two nodes together forever. All Glue really does is keep them together long enough for LLVM to put together a data dependency through "Uses" and "Defs" implicit operands. Once the MachineInstrs have been created, the two instructions are at the whim of the scheduler as much as any others. If you really need them to remain together, you have to either create a pseudo-instruction and expand it extremely late, or create a bundle (depending on what's natural for your target). That said, you usually just have to call SelectionDAG::getNode with an SDVTList containing some Glue for it to work as intended. The only time I've had that fail is when I forgot to add the Uses/Defs values to the Instructions, so they couldn't be matched up. What problems are you seeing from your attempts? Cheers. Tim.
Philip Reames
2014-Jun-23 17:14 UTC
[LLVMdev] How to add a MVT::Glue property of intrinsic node?
On 06/23/2014 08:20 AM, Tim Northover wrote:> Hi Haishan, > > On 23 June 2014 16:07, Haishan <hndxvon at 163.com> wrote: >> I have implemented a pair intrinsic nodes in back-end, But there is a >> chain dependence between two intrinsic nodes. So in the Pre-RA-sched stage, >> these two intrinsic nodes would be apart. I expect that there is no node >> between these two intrinsic nodes, therefore, I guess it would be work if >> there is a MVT::Glue between these nodes. But I don’t know how to add. > You can't Glue the two nodes together forever. All Glue really does is > keep them together long enough for LLVM to put together a data > dependency through "Uses" and "Defs" implicit operands. Once the > MachineInstrs have been created, the two instructions are at the whim > of the scheduler as much as any others. > > If you really need them to remain together, you have to either create > a pseudo-instruction and expand it extremely late, or create a bundle > (depending on what's natural for your target).I just want to second Tim's point here. We tried to take the "separate but tied together" scheme in an early implementation of our safepoint work, and it was a really bad idea. It "mostly" worked, but we kept running into a long series of subtle issues. I *strongly* suggest you use the pseudo op approach. That has worked fairly well for us.> > That said, you usually just have to call SelectionDAG::getNode with an > SDVTList containing some Glue for it to work as intended. The only > time I've had that fail is when I forgot to add the Uses/Defs values > to the Instructions, so they couldn't be matched up. What problems are > you seeing from your attempts? > > Cheers. > > Tim. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] How to update LiveInterval information of newly inserted machine basic block
- [LLVMdev] How to update LiveInterval information of newly inserted machine basic block
- [LLVMdev] How to update LiveInterval information of newly inserted machine basic block
- [LLVMdev] Question about Pre-RA-schedule in LLVM3.3
- [LLVMdev] How to update LiveInterval information of newly inserted machine basic block