[PATCH] D31613: [LoopPeeling] Get rid of Phis that become invariant after N steps
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 13:38:32 PDT 2017
mkazantsev 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.
----------------
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.
https://reviews.llvm.org/D31613
More information about the llvm-commits
mailing list