[PATCH] D40353: [Loop Predication] Teach LP about reverse loops

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 06:33:17 PST 2017


anna created this revision.

Currently, we only support predication for forward loops with step
of 1.  This patch enables loop predication for reverse or
countdownLoops, which satisfy the following conditions:

1. The step of the IV is -1.
2. The loop has a singe latch as B(X) = X <pred>

latchLimit with pred as s> or u>

3. The IV of the guard is the decrement

IV of the latch condition (Guard is: G(X) = X-1 u< guardLimit).

This patch was downstream for a while and is the last series of patches
that's from our LP implementation downstream.


https://reviews.llvm.org/D40353

Files:
  lib/Transforms/Scalar/LoopPredication.cpp
  test/Transforms/LoopPredication/reverse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40353.123931.patch
Type: text/x-patch
Size: 17534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171122/7bb6d938/attachment-0001.bin>


More information about the llvm-commits mailing list