[PATCH] D29727: [SLP] Fix for PR31690: Allow using of extra values in horizontal reductions.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 12:41:32 PST 2017


ABataev created this revision.

Currently, LLVM supports vectorization of horizontal reduction
instructions with initial value set to 0. Patch supports vectorization
of reduction with non-zero initial values. Also, it supports a
vectorization of instructions with some extra arguments, like:

  float f(float x[], int a, int b) {
    float p = a % b;
    p += x[0] + 3;
    for (int i = 1; i < 32; i++)
      p += x[i];
    return p;
  }

Patch allows vectorization of this kind of horizontal reductions.


https://reviews.llvm.org/D29727

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/horizontal-list.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29727.87691.patch
Type: text/x-patch
Size: 71312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170208/198a4e69/attachment.bin>


More information about the llvm-commits mailing list