[PATCH] D54464: Add a new reduction pattern match

Masakazu Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 22:55:45 PST 2018


masakazu.ueno created this revision.
masakazu.ueno added reviewers: mkuper, karthikthecool, TylerNowicki, mcrosier, t.p.northover, fhahn, RKSimon, dcaballe, rengolin.
Herald added a subscriber: llvm-commits.

Adding a new reduction pattern match for vectorizing code similar to TSVC s3111:

for (int i = 0; i < N; i++)

  if (a[i] > b)
    sum += a[i];

This patch adds support for fadd, fsub and fmull, as well as multiple
branches and different (but compatible) instructions (ex. add+sub) in
different branches.

The difference from the previous patch(https://reviews.llvm.org/D49168) is as follows.

- Added check of fast-math property of fp-instruction to the previous patch.
- Fix/add some pattern for if-reduction.ll.


Repository:
  rL LLVM

https://reviews.llvm.org/D54464

Files:
  include/llvm/Analysis/IVDescriptors.h
  lib/Analysis/IVDescriptors.cpp
  test/Transforms/LoopVectorize/if-reduction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54464.173813.patch
Type: text/x-patch
Size: 39272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/772e2716/attachment.bin>


More information about the llvm-commits mailing list