dg icon indicating copy to clipboard operation
dg copied to clipboard

Is there some method to check if tow nodes are conneced in a directed graph in DG?

Open Marvinmw opened this issue 6 years ago • 7 comments

Is there some method to check if tow nodes are conneced in a directed graph in DG?

Marvinmw avatar Jan 06 '20 08:01 Marvinmw

Which graph? The best what you can do is to do some kind of BFS/DFS. DG has some predefined templates for that.

mchalupa avatar Jan 06 '20 11:01 mchalupa

Which graph? The best what you can do is to do some kind of BFS/DFS. DG has some predefined templates for that.

It is a LLVMDependGraph. Is it possible to build SCC using LLVMNode?

Marvinmw avatar Jan 06 '20 12:01 Marvinmw

Which graph? The best what you can do is to do some kind of BFS/DFS. DG has some predefined templates for that.

The essential question is that I want to map the instruction in LLVM bitcode to LLVMNode in LLVMDependGraph. But I find that my current solution is wrong. I store llvm::Value * and use findNode , but findNode return nullptr.

Marvinmw avatar Jan 06 '20 14:01 Marvinmw

The API of LLVMDependenceGraph is now... well, not nice. I'm working on better one. However, you need to get the right dependence graph and search for the instruction there: https://github.com/mchalupa/dg/blob/master/include/dg/llvm/LLVMDependenceGraph.h#L229 (you can use https://github.com/mchalupa/dg/blob/master/include/dg/llvm/LLVMDependenceGraph.h#L233)

mchalupa avatar Jan 07 '20 06:01 mchalupa

The API of LLVMDependenceGraph is now... well, not nice. I'm working on better one. However, you need to get the right dependence graph and search for the instruction there: https://github.com/mchalupa/dg/blob/master/include/dg/llvm/LLVMDependenceGraph.h#L229 (you can use https://github.com/mchalupa/dg/blob/master/include/dg/llvm/LLVMDependenceGraph.h#L233)

Hi, thanks. I find that there is another easy solution. I want to use the dependentable dot file from llvm-dump. Is ti that the node identifier is the pointer address of llvm::Value *?

Marvinmw avatar Jan 07 '20 17:01 Marvinmw

No, the node identifier is the address of the node.

mchalupa avatar Jan 08 '20 08:01 mchalupa

No, the node identifier is the address of the node.

Thanks a lot.

Marvinmw avatar Jan 09 '20 08:01 Marvinmw