[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 13:45:07 PST 2016


mkuper updated this revision to Diff 78255.
mkuper marked 12 inline comments as done.
mkuper added a comment.

Updated per comments.
Also changed getLoopEstimatedTripCount() to round-to-nearest when dividing.

This was probably the right thing to do to begin with, and compensates for an off-by-one if we have very precise, but adjusted by clang, branch weights.
If the original edge weights were 3000 and 1000, we really want to peel off 3 iterations, but 3001/1001 = 2.99.. and the previous code would truncate it to 2.


https://reviews.llvm.org/D25963

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Transforms/Utils/LoopUtils.h
  include/llvm/Transforms/Utils/UnrollLoop.h
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  lib/Transforms/Utils/CMakeLists.txt
  lib/Transforms/Utils/LoopUnroll.cpp
  lib/Transforms/Utils/LoopUnrollPeel.cpp
  lib/Transforms/Utils/LoopUtils.cpp
  test/Transforms/LoopUnroll/peel-loop-pgo.ll
  test/Transforms/LoopUnroll/peel-loop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25963.78255.patch
Type: text/x-patch
Size: 33879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/da1c992a/attachment.bin>


More information about the llvm-commits mailing list