SiliconValleyEmployee - via llvm-dev
2016-Oct-12 16:31 UTC
[llvm-dev] Selection DAG adding node question
I am having trouble adding a node to the selection DAG (e.g. during combine) E.g. node1 -> use1, use2 Now if you add a node2, with node1 -> node2 with node2 number of output values equal node1 number of output values, then combine as well as e.g. promotion pass with replace all of node1's uses with node2, leaving node1 dead. While this is kind of expected, does this mean a) always create new node (can you clone node, e.g. node1 above)? b) is this something that selection DAG is not intended for at all? c) sometimes it is not straight forward to create a new load, e.g. for loads, as DAG.getLoad will return "old" node if identical => a) can I clone a node? Thanks! Hendrik -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161012/d69073c4/attachment.html>
Ryan Taylor via llvm-dev
2016-Oct-12 17:29 UTC
[llvm-dev] Selection DAG adding node question
It is my understanding that you cannot create a clone in the DAG. This is due to common sub tree from what I understand. This is a problem for direct mem architectures, seems more and more people are having issues with this but it can be worked around. LLVM assumes a LD/ST architecture. I'd love to hear otherwise. -Ryan On Wed, Oct 12, 2016 at 12:31 PM, SiliconValleyEmployee - via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I am having trouble adding a node to the selection DAG (e.g. during > combine) > > E.g. node1 -> use1, use2 > > Now if you add a node2, with node1 -> node2 with node2 number of output > values equal node1 number of output values, then combine as well as e.g. > promotion pass with replace all of node1's uses with node2, leaving node1 > dead. While this is kind of expected, does this mean > > a) always create new node (can you clone node, e.g. node1 above)? > b) is this something that selection DAG is not intended for at all? > c) sometimes it is not straight forward to create a new load, e.g. for > loads, as DAG.getLoad will return "old" node if identical => a) can I clone > a node? > > Thanks! Hendrik > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161012/f8263f42/attachment.html>
Ryan Taylor via llvm-dev
2016-Oct-12 18:02 UTC
[llvm-dev] Selection DAG adding node question
So you want to create a new node, set new node's inputs the same as old node's (along with the output?) and delete old node? yes, this is possible. On Wed, Oct 12, 2016 at 1:50 PM, SiliconValleyEmployee - < hendrik.greving.samsung at gmail.com> wrote:> Regardless of not being able to clone (which may or may not make sense), > is selection DAG supporting (by the way, I am on llvm-3.6) what I am > intending to do as it is right now? > > On Wed, Oct 12, 2016 at 10:29 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > >> It is my understanding that you cannot create a clone in the DAG. This is >> due to common sub tree from what I understand. >> >> This is a problem for direct mem architectures, seems more and more >> people are having issues with this but it can be worked around. >> >> LLVM assumes a LD/ST architecture. >> >> I'd love to hear otherwise. >> >> -Ryan >> >> On Wed, Oct 12, 2016 at 12:31 PM, SiliconValleyEmployee - via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> I am having trouble adding a node to the selection DAG (e.g. during >>> combine) >>> >>> E.g. node1 -> use1, use2 >>> >>> Now if you add a node2, with node1 -> node2 with node2 number of output >>> values equal node1 number of output values, then combine as well as e.g. >>> promotion pass with replace all of node1's uses with node2, leaving node1 >>> dead. While this is kind of expected, does this mean >>> >>> a) always create new node (can you clone node, e.g. node1 above)? >>> b) is this something that selection DAG is not intended for at all? >>> c) sometimes it is not straight forward to create a new load, e.g. for >>> loads, as DAG.getLoad will return "old" node if identical => a) can I clone >>> a node? >>> >>> Thanks! Hendrik >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >>> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161012/6968f52d/attachment-0001.html>