Code Monkey home page Code Monkey logo

dfgentool's Introduction

Prerequisite

  1. Download and install LLVM-3.4 and the Clang frontend (version 3.4) following the instructions given in the Getting Started manual.
  • Compile LLVM with the debug flag set (e.g. ./configure --disable-optimized followed by make -j4)
  1. Following the Getting Started Quickly (A Summary) you should have a build directory in /path_to_llvm_directory.
  2. Check, if the HelloWorld Example is working. (optionally)

Build Instructions

  1. Create a new directory in /path_to_llvm_directory/build/lib/Transforms.
  2. Clone the code of DFGenTool into that directory.
  3. Execute make in the newly created directory DFGenTool.
  4. A shared object file named loop_graph_analysis_0.so will be created in /path_to_llvm_directory/build/Debug+Asserts/lib.

Using DFGenTool

Examples are supplied in the example directory of the repository (currently residing in /path_to_llvm_directory/build/lib/Transforms/DFGenTool/). In this section we walk through the simpleAdder

  1. Generate a file containing the intemediate code (.ll) execute:
    /path_to_llvm_directory/build/bin/clang -O1 -emit-llvm simpleAdder.c -S -o simpleAdder_generated.ll
    
  2. To create a dot file from the intermediate code which can be further processed by graphviz tools, use the following command:
    /path_to_llvm_directory/build/bin/opt -load  /path_to_llvm_directory/built/Debug+Asserts/lib/loop_graph_analysis_0.so -loop-graph-analysis-0 simpleAdder_generated.ll
    
  3. Two new files are created in the same directory: 0.loop_analysis_graph.dot and 0.loop_analysis_graph.graph. Compare both dot files containing the flow graphs.

dfgentool's People

Contributors

manideepam avatar

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.