[PATCH] D43876: [LoopUnroll] Peel off iterations if it makes conditions true/false.

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 07:22:18 PST 2018


junbuml added a comment.

To remove the conditional branch in general, I think we can split the loop like :

  Min = min(1000, M);
  unsigned i;
  for (i = 0; i; i < Min; ++i) {
      ... something
  }
  
  for (; i; i < 1000; ++i) {
      ... something else
  }

@samparker, will your pass perform something like this or something else ?

I believe peeling is a special case of such loop splitting, but peeling itself is worthwhile to do for a low constant bound.


https://reviews.llvm.org/D43876





More information about the llvm-commits mailing list