Shen Liu
2015-Mar-04 18:27 UTC
[LLVMdev] How to print "Instruction" nodes instead of "BasicBlock" in a .dot file ?
Dear LLVM developers, I am Shen, a PhD student in computer science in lehigh university. Now I am using LLVM to generate a Program Dependence Graph(PDG), and each node in my graph represent a statement(should be an Instruction in LLVM, i think). Now I have generated a coarse PDG on BasicBlock level as shown in the following figure, using APIs such as std::string getNodeLabel(const BasicBlock <http://llvm.org/docs/doxygen/html/classllvm_1_1BasicBlock.html> *Node <http://llvm.org/docs/doxygen/html/DominanceFrontierImpl_8h.html#adeb436e8060b57a35092e28f77eeb7d3>, const Function <http://llvm.org/docs/doxygen/html/classllvm_1_1Function.html> *Graph) However, all APIs I found in class DOTGraphTraits ask "BasicBlock", not Instruction for arguments. So if i want to generate a more fine-grained PDG on "Instruction" level, should i revise the llvm source code to add my new APIs, or use some built-in APIs i did't know? Or, can i generate a basicblock for each instruction? Thank you! Best regards, Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150304/e7e71401/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: sdg.png Type: image/png Size: 160159 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150304/e7e71401/attachment.png>
陳韋任
2015-Mar-06 01:46 UTC
[LLVMdev] How to print "Instruction" nodes instead of "BasicBlock" in a .dot file ?
Hi Shen, However, all APIs I found in class DOTGraphTraits ask "BasicBlock", not> Instruction for arguments. So if i want to generate a more fine-grained PDG > on "Instruction" level, should i revise the llvm source code to add my new > APIs, or use some built-in APIs i did't know? Or, can i generate a > basicblock for each instruction? Thank you! > > > All instructions in the basic block [1] should be in sequential order, the dependency is pretty clear to me, right? [1] http://en.wikipedia.org/wiki/Basic_block Regards, chenwj -- Wei-Ren Chen (陳韋任) Homepage: http://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150306/fb208240/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: sdg.png Type: image/png Size: 160159 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150306/fb208240/attachment.png>