<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Calibri Light";
        panose-1:2 15 3 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I simply tried to get the correct declarations in place to use it mimicking BasicBlock support. I got a subclass to add getParent() and its GraphTraits support then died tying in Calculate<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>class MyCallGraphNode : public CallGraphNode, public ilist_node_with_parent<MyCallGraphNode, CallGraph> {<o:p></o:p></p><p class=MsoNormal>public:<o:p></o:p></p><p class=MsoNormal>               CallGraph *getParent() { return parent; }<o:p></o:p></p><p class=MsoNormal>private:<o:p></o:p></p><p class=MsoNormal>               CallGraph *parent;<o:p></o:p></p><p class=MsoNormal>};<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>template <><o:p></o:p></p><p class=MsoNormal>struct GraphTraits<MyCallGraphNode *><o:p></o:p></p><p class=MsoNormal>{<o:p></o:p></p><p class=MsoNormal>  using NodeRef = MyCallGraphNode *;<o:p></o:p></p><p class=MsoNormal>  using ChildIteratorType = MyCallGraphNode::iterator;<o:p></o:p></p><p class=MsoNormal>  using nodes_iterator = MyCallGraphNode::iterator;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  static NodeRef getEntryNode(MyCallGraphNode *N) { return N; }<o:p></o:p></p><p class=MsoNormal>  static inline ChildIteratorType child_begin(MyCallGraphNode *N) { return ChildIteratorType(N->begin()); }<o:p></o:p></p><p class=MsoNormal>  static inline ChildIteratorType child_end(MyCallGraphNode *N) { return ChildIteratorType(N->end()); }<o:p></o:p></p><p class=MsoNormal>};<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>template void DomTreeBuilder::Calculate<DomTreeBase<MyCallGraphNode>>(DomTreeBase<MyCallGraphNode> &DT);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>static process(CallGraph &cg) {<o:p></o:p></p><p class=MsoNormal>  DomTreeBase<MyCallGraphNode> *DTB = new DomTreeBase<MyCallGraphNode>();<o:p></o:p></p><p class=MsoNormal>  DTB->recalculate(cg);<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>thanks<o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Alina Sbirlea <asbirlea@google.com> <br><b>Sent:</b> Wednesday, May 27, 2020 18:57<br><b>To:</b> David Blaikie <dblaikie@gmail.com><br><b>Cc:</b> Marcel Achim <marcel.achim@nxp.com>; llvm-dev@lists.llvm.org<br><b>Subject:</b> [EXT] Re: [llvm-dev] Attempt to use DomTreeBase on a CallGraph or CallGraphNode<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><b><span style='color:white;background:darkred'>Caution: </span></b><span style='color:white;background:darkred'>EXT Email </span><o:p></o:p></p><div><div><p class=MsoNormal>I may need more context here. <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>If you're trying to use Calculate to compute a new DT with some updates (i.e. pretend the CFG graph is different), that Calculate method is broken. It will discard the updates and return a new DT.<o:p></o:p></p></div><div><p class=MsoNormal>Yes, I'm working to fix that. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If it's something else, please give me more details so I can understand what you're trying to do.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Best,<o:p></o:p></p></div><div><p class=MsoNormal>Alina<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Wed, May 27, 2020 at 3:44 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Alina - this sounds vaguely like some of the stuff you're working on?<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Wed, May 27, 2020 at 3:43 PM Marcel Achim via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Has anyone successfully been able to implement domination over a callgraph, I’m getting stuck on supporting DomTreeBuilder for Calculate.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Many thanks<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>---<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Calibri Light",sans-serif'>Marcel Achim</span><o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-dev&data=02%7C01%7Cmarcel.achim%40nxp.com%7C8cb9128238e34179ba7808d802915bd2%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637262170623020310&sdata=KDDskK3%2FWgGwoRZG6vnWaLE3yjbcOxinw500bOw97qY%3D&reserved=0" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p></blockquote></div></blockquote></div></div></div></body></html>