GithubHelp home page GithubHelp logo

llvm_profiling's Introduction

LLVM profiling tool

This tool performs 3 things:

  1. Basic execution information including the number of LLVM instructions, basic blocks etc.
  2. Expensive instruction information like the number of memory operations, multiplications and branches since they are most likely to affect execution time.
  3. Function call information: the number of times each function is called.

Build:

$ cd llvm_profiling
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..

Run:

$ clang -S -emit-llvm -Xclang -disable-O0-optnone foo.c

The -Xclang -disable-O0-optnone flag ensures that Clang will allow later optimizations even when initially compiling without any.

The line above will generate foo.ll LLVM IR. We'll run our LLVM profiling pass on this IR and generate foo2.ll using the line below:

$ opt -load build/skeleton/libSkeletonPass.* -skeleton -S foo.ll > foo2.ll

Now that we have the transformed IR we can go ahead and compile and run it using clang:

$ clang foo2.ll
$ ./a.out 

llvm_profiling's People

Contributors

neiladit avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

imhmede token1029

llvm_profiling's Issues

error to run the project

Hello, I couldn't run the project as I got an error :

no matching function for call to ‘llvm::AtomicRMWInst::AtomicRMWInst(llvm::AtomicRMWInst::BinOp, llvm::Value*&, llvm::ConstantInt*, llvm::AtomicOrdering, llvm::SyncScope::, llvm::Instruction*)’
83 | SyncScope::System, it->getFirstNonPHI ());
| ^

could you please help me how can I solve the issue ??

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.