Hi, I am using LLVM for implementing LoopFission pass. I am using LoopPass. I know that for checking circular dependency in loop I have to use LoopDependenceAnalysis This is 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 ; } /**there is no dependence from s2 to s1/ so 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 ; but in llvm i couldn't able to find there is no dependency from s2 to s1. LoopDependenceAnalyis always gives there is a dependency from every load instructions to every store instructions. is there any other alternative to LoopDependencyAnalysis ? thank you ...... Regards, Shanmukha Rao Compilers lab, Indian Institute of Science, Bangalore. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120315/94716630/attachment.html>
Hi, did you do this on optimized IR? These kind of analyses only do a decent job if at least a basic set of optimizations has been applied. Ciao, Duncan.> I am using LLVM for implementing LoopFission pass. > I am using LoopPass. > I know that for checking circular dependency in loop I have to use > LoopDependenceAnalysis > > This is 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 ; > } > > /**there is no dependence from s2 to s1/ > so 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 ; > > > but in llvm i couldn't able to find there is no dependency from s2 to s1. > > LoopDependenceAnalyis always gives there is a dependency from every load instructions to every store instructions. > > > is there any other alternative to LoopDependencyAnalysis ? > thank you > > ...... > Regards, > Shanmukha Rao > Compilers lab, > Indian Institute of Science, Bangalore. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
thank you all for ur replies.. I looked at the sanjoys patch for SIV Test. And i figured out that this is exactly what i need. as the comments said, check if subscript A can possibly have the same value as B in *analyseSIV(A,B)* but i didn't get How to use this information ? lets just say in the above program When i use *depends* function it shows the dependency from load of x to store in x. similarily for array a. but how can i be sure that there is no dependence from store of x to load of x in the next iteration ? On Thu, Mar 15, 2012 at 11:28 AM, shanmuk rao <shanmuk.rao008 at gmail.com>wrote:> Hi, > I am using LLVM for implementing LoopFission pass. > I am using LoopPass. > I know that for checking circular dependency in loop I have to use > LoopDependenceAnalysis > > This is 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 ; > } > > /**there is no dependence from s2 to s1/ > so 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 ; > > > but in llvm i couldn't able to find there is no dependency from s2 to s1. > > LoopDependenceAnalyis always gives there is a dependency from every load instructions to every store instructions. > > > is there any other alternative to LoopDependencyAnalysis ? > thank you > > ...... > Regards, > Shanmukha Rao > Compilers lab, > Indian Institute of Science, Bangalore. >-- ...... Regards, Shanmukha Rao Compilers lab, Indian Institute of Science, Bangalore. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120320/c66d5c41/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Problem with LoopDependenceAnalysis
- [LLVMdev] Problem with LoopDependenceAnalysis
- [LLVMdev] Problem with LoopDependenceAnalysis
- [LLVMdev] Problem in accessing Loops in other Functions Problem in accessing Loops in other Functions problem in accessing the Loops in other functions
- [LLVMdev] Problem in accessing Loops in other Functions Problem in accessing Loops in other Functions problem in accessing the Loops in other functions