[LLVMdev] Program Slicing using LLVM?

Prabhat Kumar Saraswat prabhat.saraswat at gmail.com
Tue Feb 26 01:37:38 PST 2008


Hi all...
    I am developing a program slicing framework using LLVM. The idea
is to remove the computation parts from the program and only keep the
parts relevant for the control flow.
For example, in the following C loop.

for (i=0;i<=VAL;)
{

printf("In the loop");
a=b+c;
b=h+k;

i++;
printf("%d",i);
}

after slicing...

for (i=0;i<=VAL;)
{

i++;
printf("%d",i);
}


so basically, all the lines of the program which do not correspond to
the computation are removed or sliced out.


Has someone already worked on this, or are there similar components i
can reuse in my work?

I am planning to create a IntraProcedure Dependence Graph (PDG) and
then traverse along it to identify the relevant parts of the program.
Any ideas?

Regards
Prabhat



More information about the llvm-dev mailing list