[PATCH] D43826: LoopUnroll: respect pragma unroll when AllowRemainder is disabled

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 12:23:32 PST 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:733
+    if ((UP.AllowRemainder || (TripCount % PragmaCount == 0) ||
+         (TripMultiple % PragmaCount == 0)) &&
         getUnrolledLoopSize(LoopSize, UP) < PragmaUnrollThreshold)
----------------
I don't think the TripCount check here is right; if the trip count isn't constant, TripCount will be zero.

The check is unnecessary, anyway: if the trip count is constant, TripCount is the same as TripMultiple.


https://reviews.llvm.org/D43826





More information about the llvm-commits mailing list