pfalcon / graph-llvm-ir Goto Github PK
View Code? Open in Web Editor NEWVisualization of LLVM IR
Visualization of LLVM IR
(Useful) combinations of rendering options: --control (default): Renders both explicit control flow present in LLVM IR (sequential between statements in basic blocks, jumps between basic blocks), and dataflow dependencies. Control flow has higher weight (that means that control flow edges tend to be more straight). --dag-control: Ignore explicit flow control present in LLVM IR and instead compute order of evaluation of independent (i.e. disconnected) dataflow DAGs within basic block. Root node of a DAG consider to be an instruction of type void. (The idea is that void instruction is executed solely for side effect, and then it must be last instruction in evaluation of some DAG, i.e. its root. This is clearly a heuristic, which needs to be tested on various inputs yet.) --block For both options above, you can add --block to clusterize instructions of the same basic block together within a rectangle block. This seems like natural way to do it, but leaves questions open where to put leaves of dataflow graphs (i.e. variables, constants, etc.) So far, these are rendered as DAG structure also, which means they are not part of any basic block cluster. But rendering them in such way leads to edges going from different basic blocks to the same leaf nodes, leading to a mess in the graph. Possible other options: duplicate leaf nodes; don't render at all (can be kinda assumed). --block-edges This makes control edges between basic blocks actually go between basic blocks, not specific instructions in them. This may be useful for some kinds of presentations. This also removes extra nodes to represent labels. Results of the latter changes are mixed though, it leads to not ideal placing of leaf non-cluster nodes and thus deformed graphs.
Maybe line 222 should be altered to
print("Writing %s.dot" % f.name)
That would make the script Python 3 ready
Hi, I getting an AssertionError(details below) on execution of the script. Could you please see on why is this happening. Thanks.
$ ./graph-llvm-ir ./vector_sum.ll && dot −Tpdf vector_sum.dot −o vector_sum.pdf
Error:
Traceback (most recent call last):
File "./graph-llvm-ir", line 216, in
mod = Module.from_assembly(asm)
File "/usr/local/lib/python2.7/dist-packages/llvm/core.py", line 443, in from_assembly
return Module(m)
File "/usr/local/lib/python2.7/dist-packages/llvm/init.py", line 16, in init
assert ptr
AssertionError
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.