[PATCH] D68577: [LV] Apply sink-after & interleave-groups as VPlan transformations (NFC)

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 9 14:22:40 PST 2019


Ayal added a comment.

In D68577#1739605 <https://reviews.llvm.org/D68577#1739605>, @efriedma wrote:

> Testcase follows; reproduce with `opt -loop-vectorize`:


[snip]

This testcase is similar to PR40816, where a load from an array of constants feeds the compare of the loop's latch, allowing SCEV to determine the loop's trip count by looking at these constants. In this case there's a discrepancy between vectorizing such a load as an interleave group due to its strided access pattern, and scalarizing it due to being UniformAfterVectorization (see https://reviews.llvm.org/D68831#inline-627725). To be consistent with the previous behavior (of vectorizing), willWiden above should succeed if the Decision is CM_Interleave, even if the instruction isScalarAfterVectorization().

TODO notes for separate follow-up non-NFC patches:

1. It's probably better to (consistently) scalarize such cases, or even identify them as DeadInstructions, rather than vectorize them w/ or w/o an interleave group.
2. Such loops can and should be optimized to have a simple induction variable with constant trip count regardless of (and prior to) LV.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68577/new/

https://reviews.llvm.org/D68577





More information about the llvm-commits mailing list