[VPlan, SLP] Add simple SLP analysis on top of VPlan.
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 14 Nov 2018 13:11:49 +0000 (13:11 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 14 Nov 2018 13:11:49 +0000 (13:11 +0000)
commit09e516c54b0c5ec3fe6b3ef6c70d9e09e89abc95
treeffd47e67d0b056770599f2e06527d2439c996baf
parent3f82b15bdca3d471f844f5862892fabc9687807a
[VPlan, SLP] Add simple SLP analysis on top of VPlan.

This patch adds an initial implementation of the look-ahead SLP tree
construction described in 'Look-Ahead SLP: Auto-vectorization in the Presence
of Commutative Operations, CGO 2018 by Vasileios Porpodas, Rodrigo C. O. Rocha,
Luís F. W. Góes'.

It returns an SLP tree represented as VPInstructions, with combined
instructions represented as a single, wider VPInstruction.

This initial version does not support instructions with multiple
different users (either inside or outside the SLP tree) or
non-instruction operands; it won't generate any shuffles or
insertelement instructions.

It also just adds the analysis that builds an SLP tree rooted in a set
of stores. It does not include any cost modeling or memory legality
checks. The plan is to integrate it with VPlan based cost modeling, once
available and to only apply it to operations that can be widened.

A follow-up patch will add a support for replacing instructions in a
VPlan with their SLP counter parts.

Reviewers: Ayal, mssimpso, rengolin, mkuper, hfinkel, hsaito, dcaballe, vporpo, RKSimon, ABataev

Reviewed By: rengolin

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

llvm-svn: 346857
llvm/lib/Transforms/Vectorize/CMakeLists.txt
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanSLP.cpp [new file with mode: 0644]
llvm/lib/Transforms/Vectorize/VPlanValue.h
llvm/unittests/Transforms/Vectorize/CMakeLists.txt
llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp [new file with mode: 0644]