This is an archive of the discontinued LLVM Phabricator instance.

PR27392 unroll epilog TripCount overflow fix.
ClosedPublic

Authored by evstupac on Apr 18 2016, 11:42 PM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

evstupac updated this revision to Diff 54162.Apr 18 2016, 11:42 PM
evstupac retitled this revision from to PR27392 unroll epilog TripCount overflow fix. .
evstupac updated this object.
evstupac added reviewers: sanjoy, mzolotukhin.
evstupac set the repository for this revision to rL LLVM.
evstupac added a subscriber: llvm-commits.
hfinkel accepted this revision.Apr 26 2016, 1:33 PM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

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.

lib/Transforms/Utils/LoopUnrollRuntime.cpp
581

Count - 1 is a parameter to ConstantInt::get, not CreateICmpULT. I'd prefer that it be indented accordingly (so it is under BECount->getType()).

This revision is now accepted and ready to land.Apr 26 2016, 1:33 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r267662.