[PATCH] D31613: [LoopPeeling] Get rid of Phis that become invariant after N steps

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 13:48:22 PDT 2017


sanjoy added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUnrollPeel.cpp:149
+  // First, check that we can peel at least one iteration.
+  if (2 * LoopSize <= UP.Threshold) {
+    // Store pre-calculated values of Depth here.
----------------
mkazantsev wrote:
> sanjoy wrote:
> > Why did you change the condition to `2 * LoopSize <= UP.Threshold`?
> Because initially it was wrong. The threshold applies to the total number of iterations after peeling, not to loop's size, see line 202. If we peel once, the cost would be 2 * LoopSize.
Can you please fix that separately with a test?


https://reviews.llvm.org/D31613





More information about the llvm-commits mailing list