[PATCH] D24790: [LoopUnroll] Use the upper bound of the loop trip count to completely unroll loops
Evgeny Stupachenko via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 14 18:48:02 PST 2016
evstupac added inline comments.
================
Comment at: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp:1027
// Unroll the loop.
if (!UnrollLoop(L, UP.Count, TripCount, UP.Force, UP.Runtime,
+ UP.AllowExpensiveTripCount, UseUpperBound, TripMultiple, LI,
----------------
Sorry for comment after approve.
What I see here is that TripCount could implicitly (as TripCount was passed to computeUnrollCount as a reference) become MaxTripCount. Here it is passed to UnrollLoop as TripCount.
Could you please add a comment to UnrollLoop that TripCount parameter is not always a real loop trip count, but sometimes MaxTripCount. Or rename TripCount to MaxTripCount in UnrollLoop parameters. There could be future errors if someone assumes that TripCount is exact loop trip count.
Repository:
rL LLVM
https://reviews.llvm.org/D24790
More information about the llvm-commits
mailing list