Giter Club home page Giter Club logo

graph-llvm-ir's Introduction

(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.

graph-llvm-ir's People

Contributors

dmikushin avatar pfalcon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graph-llvm-ir's Issues

Python 3 support

Maybe line 222 should be altered to

print("Writing %s.dot" % f.name)

That would make the script Python 3 ready

AssertionError

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.