[PATCH] D80081: [LoopUnroll] Reset PeelCount on exit before computePeelCount.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 17 06:55:00 PDT 2020


fhahn created this revision.
fhahn added reviewers: efriedma, hfinkel.
Herald added subscribers: zzheng, hiraditya.
Herald added a project: LLVM.

Currently UP.PeelCount can be set by either TTI or -unroll-peel-count,
before computePeelCount is actually called. computePeelCount also checks
if the loop can be peeled and if we exit before calling it, the
PeelCount is set regardless whether the loop can be peeled or not.

If we exit before computePeelCount, we should set the PeelCount to 0.
Alternatively we could also just check if the loop is peel-able in
peelLoop(), but I think it is reasonable for the caller to ensure that
it is only called with peel-able loops. We could also call
computePeelCount, instead of setting it to zero, in case PeelCount != 0.
But that's probably worth doing as a follow-up.

Note that now it is not possible to combine peeling and unrolling in the
same step using LoopUnrollPass I think, hence the test changes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80081

Files:
  llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
  llvm/test/Transforms/LoopUnroll/pr33437.ll
  llvm/test/Transforms/LoopUnroll/pr45939-peel-count-and-complete-unroll.ll
  llvm/test/Transforms/LoopUnroll/pr45940-unroll-peel-unpeelable-loop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80081.264491.patch
Type: text/x-patch
Size: 11188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200517/34669e0f/attachment.bin>


More information about the llvm-commits mailing list