problem in implementing loop fission using ModulePass

Hi,
I am trying to implement my own Loop fission transformations in llvm.
But to find circular dependency, i think i have to use LoopDependenceAnalysis.
I am using ModulePass.
In this pass I am getting LoopInfo and Loops. but when I try to use LoopDependenceAnalysis
It throws segmentation fault.
the example shows what i want to do :

        for(int i = 0; i< n ; i++){
s1 :                 a[i] = a[i] + x[i];
s2 :                 x[i] = x[i+1] + i*2 ;
        }

/*I have to find here that from s2 to s1 there is no dependency 
* but there is dependency from s1 to s2
* I wont consider the RAR dependency
*/

after distribution(it should be) :

        for(int i = 0; i< n ; i++)
s1:                a[i] = a[i] + x[i];

        for(int i = 0; i< n ; i++)
s2:                x[i] = x[i+1] + i*2 ;

I think there is a function isDependendent() in LoopDependencyAnalysis.

thank you,
shanmuk