[PATCH] Loop Versioning for LICM

silviu.baranga at arm.com silviu.baranga at arm.com
Thu May 21 03:54:34 PDT 2015


Thanks for working on this! This has the potential of solving a lot of other problems as well.

I think there would be a problem in cases where some aliasing issue is preventing SCEV from computing the loop trip count? For example:

1 int foo(int * var1, int * var2, int * var3) {
2 unsigned j = 0;
3 
4 for(; j < *var2; j++) {
5   var3[j] = 2 * var1[j];
6 }
7 }
Here var2 can alias with var3[j] so *var2 would not be considered loop invariant, which would cause SCEV to not be able to compute the trip count.

That would be a difficult thing to solve and I'm not saying that this should be part of this work, but it would be good if we could think at least in principle now how we could work around that (I believe it is actually possible to fix the issue using runtime checks) and make sure the design reflects this.

My guess is that this would require some loop structure that would be similar to what the loop vectorizer is using - which would increase the number of similarities with the loop vectorizer. Would there be any reason not to use the same loop structure the loop vectorizer is using (and share the code that generates it) right now? I think this would actually simplify some parts of the pass and should be the good to do anyway.

Cheers,
Silviu


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9151

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list