Dynamic Analysis

I want to find the dynamic slice of a given code. Is this already
implemented in LLVM?. If not which functions are there in the LLVM to
do dynamic analysis.


I am not able to find the documentation on SPEDI. Or the source code for the project.

Thanks and Regards,

Dear Tarun,

Swarup Sahoo and I wrote some LLVM passes for dynamic slicing for LLVM 2.6. I believe we had planned to make the code publicly available as part of the Giri project (http://llvm.org/viewvc/llvm-project/giri/trunk), but due to other commitments, we have not moved the code into that SVN repository yet.

Let me check with Vikram and Swarup to see about getting a copy of the code to you. Even if we do not fold it into the SVN repository right away, I think we can send you a copy of what we have directly.

-- John T.

Thanks John,
I would be a great help. It will save lots of time for me.

Thanks and Regards,

Dear John,

Now, I want to do dynamic analysis by dynamic slicing based on LLVM. I just
see that you have implemented dynamic slicing for LLVM. I also check the
Giri project, and I don't find the code. I hope I can learn something from
your code. I am very appreciated if you can tell me how to get the code or
send me one copy.

Thank you very much!


Hi, Pengfei,

John and Dr. Swarup shared the code to me and I did some improvements this summer (supported by GSoC 2013). The code repository is at github: https://github.com/liuml07/giri

We’re very glad that you are interested in doing dynamic analysis in LLVM too. I think we can work on this open source project together if you would like to join. Re-creating wheels is not needed if we can make the current tool general and most importantly, good, enough.


Hi Pengfei,

Glad you tried the program and it works fine to you for the first place. Dr. Swarup and John from UIUC wrote most of the code, and released the original code to public. Dynamic slicing tool is really very useful.

Giri is now far from perfect. For example, there are know bugs for multi-thread programs and I’m fixing it these weeks. I will take charge of this project for a while and hopefully more people will join it. Dr. Swarup and John will give us directions and suggestions (including coding reviews) if we meet challenges. Dr. Swarup also suggested some works we should do next. I shall maintain a TODO list in the wiki page of this project. Thus you can pick up one and make improvements according to your interest and schedule. The most obvious one is to make the code work with latest LLVM 3.4.

To get to know how the slicing passes work, there are sever papers for your information:

  • Differential Slicing: Identifying Causal Execution Differences for Security Applicaitons

  • Dynamic Program Slicing

  • Precise Dynamic Slicing Algorithms

  • Using Likely Invariants for Automated Software Fault Localization

Good luck!