[PATCH] D20115: Loop unroller: set thresholds for optsize and minsize functions to zero

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 13:36:14 PDT 2016


hans updated this revision to Diff 56797.
hans added a comment.

In http://reviews.llvm.org/D20115#426187, @mzolotukhin wrote:

> In general I agree with what this patch is trying to fix, but wouldn't it be easier to just set `PartialOptSizeThreshold` and `OptSizeThreshold` to `0` in `BasicTTI`? These attributes are aimed exactly at what you are trying to solve, but we just happened to not initialize them with proper values.


Oops, I completely missed that these thresholds could be overridden by TTI. Thanks!

It seems the defaults are set here in gatherUnrollingPreferences() though, and then TTI can adjust them if it likes. I've updated the patch to simplify set the defaults to 0. Please take another look.


http://reviews.llvm.org/D20115

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/PowerPC/a2-unrolling.ll
  test/Transforms/LoopUnroll/PowerPC/p7-unrolling.ll
  test/Transforms/LoopUnroll/partial-unroll-optsize.ll
  test/Transforms/LoopUnroll/unroll-opt-attribute.ll
  test/Transforms/LoopUnroll/unroll-pragmas.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20115.56797.patch
Type: text/x-patch
Size: 8844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160510/81467604/attachment.bin>


More information about the llvm-commits mailing list