[llvm-dev] [EXT] Re: Attempt to use DomTreeBase on a CallGraph or CallGraphNode

Marcel Achim via llvm-dev llvm-dev at lists.llvm.org
Thu May 28 06:13:47 PDT 2020


Hi,

 

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

 

class MyCallGraphNode : public CallGraphNode, public ilist_node_with_parent<MyCallGraphNode, CallGraph> {

public:

               CallGraph *getParent() { return parent; }

private:

               CallGraph *parent;

};

 

template <>

struct GraphTraits<MyCallGraphNode *>

{

  using NodeRef = MyCallGraphNode *;

  using ChildIteratorType = MyCallGraphNode::iterator;

  using nodes_iterator = MyCallGraphNode::iterator;

 

  static NodeRef getEntryNode(MyCallGraphNode *N) { return N; }

  static inline ChildIteratorType child_begin(MyCallGraphNode *N) { return ChildIteratorType(N->begin()); }

  static inline ChildIteratorType child_end(MyCallGraphNode *N) { return ChildIteratorType(N->end()); }

};

 

template void DomTreeBuilder::Calculate<DomTreeBase<MyCallGraphNode>>(DomTreeBase<MyCallGraphNode> &DT);

 

static process(CallGraph &cg) {

  DomTreeBase<MyCallGraphNode> *DTB = new DomTreeBase<MyCallGraphNode>();

  DTB->recalculate(cg);

}

 

thanks

From: Alina Sbirlea <asbirlea at google.com> 
Sent: Wednesday, May 27, 2020 18:57
To: David Blaikie <dblaikie at gmail.com>
Cc: Marcel Achim <marcel.achim at nxp.com>; llvm-dev at lists.llvm.org
Subject: [EXT] Re: [llvm-dev] Attempt to use DomTreeBase on a CallGraph or CallGraphNode

 

Caution: EXT Email 

I may need more context here. 

 

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.

Yes, I'm working to fix that. 

 

If it's something else, please give me more details so I can understand what you're trying to do.

 

Best,

Alina

 

 

 

On Wed, May 27, 2020 at 3:44 PM David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com> > wrote:

Alina - this sounds vaguely like some of the stuff you're working on?

 

On Wed, May 27, 2020 at 3:43 PM Marcel Achim via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > wrote:

Hi,

 

Has anyone successfully been able to implement domination over a callgraph, I’m getting stuck on supporting DomTreeBuilder for Calculate.

 

Many thanks

---

Marcel Achim

_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> 
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <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> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200528/d7712817/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 9585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200528/d7712817/attachment-0001.bin>


More information about the llvm-dev mailing list