6 Commits

Author SHA1 Message Date
Renato Golin
5b0ffb89bd Fix parenthesis warning in IVDescriptors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347990 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-30 13:54:36 +00:00
Renato Golin
4e25c19165 Add a new reduction pattern match
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


Differential Revision: https://reviews.llvm.org/D54464

Patch by Takahiro Miyoshi <takahiro.miyoshi@linaro.org>
     and Masakazu Ueno <masakazu.ueno@linaro.org>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-30 13:40:10 +00:00
Renato Golin
a8bdd2f238 Revert r344172: [LV] Add a new reduction pattern match
This patch has caused fast-math issues in the reduction pattern.

Will re-work and land again.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-27 22:13:43 +00:00
Renato Golin
ca0c32a3b8 [LV] Add a new reduction pattern match
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.

I have forwarded to trunk, added fsub and fmul functionality and
additional tests, but the credit goes to Takahiro, who did most of the
actual work.

Differential Revision: https://reviews.llvm.org/D49168

Patch by Takahiro Miyoshi <takahiro.miyoshi@linaro.org>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344172 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10 18:49:49 +00:00
Ilya Biryukov
ab4b357430 Remove unused include from IVDescriptors.cpp.
This fixes a layering violation:

Analysis/IVDescrtors.cpp can't include Transforms/Utils/BasicBlockUtils.h,
since TransformUtils depends on Analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342024 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 07:22:46 +00:00
Vikram TV
479b4ab2b0 Break LoopUtils into an Analysis file.
Summary:
The InductionDescriptor and RecurrenceDescriptor classes basically analyze the IR to identify the respective IVs. So, it is better to have them in the "Analysis" directory instead of the "Transforms" directory.

The rationale for this is to make the Induction and Recurrence descriptor classes available for analysis passes. Currently including them in an analysis pass produces link error (http://lists.llvm.org/pipermail/llvm-dev/2018-July/124456.html).

Induction and Recurrence descriptors are moved from Transforms/Utils/LoopUtils.h|cpp to Analysis/IVDescriptors.h|cpp.

Reviewers: dmgreen, llvm-commits, hfinkel

Reviewed By: dmgreen

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D51153

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342016 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 01:59:43 +00:00