[PATCH] D30161: [LoopPeeling] Peel loops with invariant backedge Phi input

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 21:13:41 PST 2017


mkazantsev added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:788
+  // 4th priority is loop peeling
+  computePeelCount(L, LoopSize, UP);
+  if (UP.PeelCount) {
----------------
anna wrote:
> Can this patch be separated into 2 parts, where the second part is this change to the priority?
The problem here is that without this change, if UP.Partial is not set, line 803 prevents us from peeling (we return from method with false),  and if UP.Partial is set, we may unroll the loop rather than peel it and have a worse result. So the test in this patch doesn't work without this re-prioritizing. I can split it into 2 patches, but priority change will be a parent and peeling change will depend on it.


https://reviews.llvm.org/D30161





More information about the llvm-commits mailing list