[PATCH] D24790: [LoopUnroll] Use the upper bound of the loop trip count to completely unroll loops

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 09:51:17 PDT 2016


haicheng added inline comments.


> haicheng wrote in LoopUnrollPass.cpp:779
> `TripCount `and `MaxTripCount `cannot both be non zero because `MaxTripCount `is computed only if `TripCount `is Zero.  If one is non zero, the other one must be zero.  If they are both zero, `FullUnrollTripCount `is zero and then we cannot enter here.

I also added a sentence in the comment to describe this.

> haicheng wrote in LoopUnroll.cpp:543
> I intended to replace `if `with `else if`.  Using complete unroll should not enter the `else if` part.  I think the change improves the readability.

Without the change of `else if`, the logic of my patch is also wrong.

Repository:
  rL LLVM

https://reviews.llvm.org/D24790





More information about the llvm-commits mailing list