[LLVMdev] problem in implementing loop fission using ModulePass

shanmuk rao shanmuk.rao008 at gmail.com
Mon Mar 5 03:42:05 PST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120305/dbf61896/attachment.html>


More information about the llvm-dev mailing list