[llvm-commits] [llvm] r154007 - /llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp
etherzhhb at gmail.com
Wed Apr 4 07:24:29 CDT 2012
On Wed, Apr 4, 2012 at 8:07 PM, Hongbin Zheng <etherzhhb at gmail.com> wrote:
> Hi tobi,
> It looks like a trivial typo , as you can find the comment of "Threshold":
> // Determine the current unrolling threshold. While this is normally set
> // from UnrollThreshold, it is overridden to a smaller value if the current
> // function is marked as optimize-for-size, and the unroll threshold was
> // not user specified.
> unsigned Threshold = CurrentThreshold;
> if (!UserThreshold &&
> Threshold = OptSizeUnrollThreshold;
I think here it should use
Threshold = std::min(OptSizeUnrollThreshold, Threshold);
Otherwise users are not able unroll the loop with a threshold that is
small than OptSizeUnrollThreshold for function with "OptimizeForSize"
We can also provide a command line option to allow users to assign the
value of OptSizeUnrollThreshold.
More information about the llvm-commits