[PATCH] D19256: PR27392 unroll epilog TripCount overflow fix.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 13:33:14 PDT 2016


hfinkel added a subscriber: hfinkel.
hfinkel accepted this revision.
hfinkel added a reviewer: hfinkel.
hfinkel added a comment.
This revision is now accepted and ready to land.

> We should compare BECount with (Count - 1) instead of TripCount with xtraiter.


When you commit this, make sure that the description explains why (unsigned overflow on TripCount).

Otherwise, I think this makes sense, and is consistent with how we do the `tripcount < loopfactor` check in the prologue case. LGTM.


================
Comment at: lib/Transforms/Utils/LoopUnrollRuntime.cpp:581
@@ +580,3 @@
+                                           ConstantInt::get(BECount->getType(),
+                                           Count - 1)) :
+                           B.CreateIsNotNull(ModVal, "lcmp.mod");
----------------
Count - 1 is a parameter to ConstantInt::get, not CreateICmpULT. I'd prefer that it be indented accordingly (so it is under BECount->getType()).


Repository:
  rL LLVM

http://reviews.llvm.org/D19256





More information about the llvm-commits mailing list