[LLVMdev] Interprocedural slicing using LLVM

John Criswell criswell at illinois.edu
Wed Jun 27 09:49:40 PDT 2012


On 6/26/12 5:07 PM, amruth.rd wrote:
> Hello,
>
> I am curious to know if LLVM offers any passes to do interprocedural slicing,  I need to eliminate most of the computations(possibly all, if they don't influence the control flow), but the control flow of the program should be maintained at all cost. I did see an optimization pass to print the CFG of a function without its body to a dot file, but I am interested in generating the source code which gets printed to a dot file.

There are two static backwards slicing passes for LLVM.

The first is a partial implementation I wrote for a course project. The 
code is in the giri project:

svn co https://llvm.org/svn/llvm-project/giri/trunk giri

The Giri code runs with an older version of LLVM and probably needs some 
TLC.  It also only backtracks until it hits a load; additional code must 
be written to backtrack further to find potentially reaching stores.

The second option is to use some code written by Jiri Slaby at 
https://github.com/jirislaby/LLVMSlicer.  I believe his implementation 
is a complete static backwards slicer, but I haven't used it myself, so 
I don't know it's quality or what version of LLVM it uses.

I think someone at UW-Madison may have an implementation as well; I'll 
contact that person and see.

-- John T.

>
> Thanks,
> Amruth
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list