[PATCH] D44880: [Hexagon] peel loops with runtime small trip counts

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 21:10:23 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:223
                             unsigned &TripCount, ScalarEvolution &SE) {
   assert(LoopSize > 0 && "Zero loop size is not allowed!");
+  if (!canPeel(L)) {
----------------
You only need preset peel count in one place. How about remembering it into a variable in the beginning of the method, zeroing `UP.PeelCount` and using the variable where you need it? Then you will not need to zero `UP.PeelCount` before every return.


https://reviews.llvm.org/D44880





More information about the llvm-commits mailing list