1356 Commits

Author SHA1 Message Date
Chandler Carruth
3f7e6da696 Revert r311077: [LV] Using VPlan ...
This causes LLVM to assert fail on PPC64 and crash / infloop in other
cases. Filed http://llvm.org/PR34248 with reproducer attached.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20 23:17:11 +00:00
Aditya Kumar
70fb4705b4 [Loop Vectorize] Added a separate metadata
Added a separate metadata to indicate when the loop
has already been vectorized instead of setting width and count to 1.

Patch written by Divya Shanmughan and Aditya Kumar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20 10:32:41 +00:00
Chandler Carruth
33ba3ea4de [SLP] Fix an unused variable warning in non-asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19 05:06:23 +00:00
Dinar Temirbulatov
484d59e444 [SLPVectorizer] Tighten up VLeft, VRight declaration, remove unnecessary testcase test/Transforms/SLPVectorizer/X86/reorder.ll, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19 03:15:07 +00:00
Dinar Temirbulatov
ef0eca1bd9 [SLPVectorizer] Add opcode parameter to reorderAltShuffleOperands, reorderInputsAccordingToOpcode functions.
Reviewers: mkuper, RKSimon, ABataev, mzolotukhin, spatel, filcab

Subscribers: llvm-commits, rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311221 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19 02:54:20 +00:00
Ayal Zaks
cd8f8f7fd4 [LV] Using VPlan to model the vectorized code and drive its transformation
VPlan is an ongoing effort to refactor and extend the Loop Vectorizer. This
patch introduces the VPlan model into LV and uses it to represent the vectorized
code and drive the generation of vectorized IR.

In this patch VPlan models the vectorized loop body: the vectorized control-flow
is represented using VPlan's Hierarchical CFG, with predication refactored from
being a post-vectorization-step into a vectorization planning step modeling
if-then VPRegionBlocks, and generating code inline with non-predicated code. The
vectorized code within each VPBasicBlock is represented as a sequence of
Recipes, each responsible for modelling and generating a sequence of IR
instructions. To keep the size of this commit manageable the Recipes in this
patch are coarse-grained and capture large chunks of LV's code-generation logic.
The constructed VPlans are dumped in dot format under -debug.

This commit retains current vectorizer output, except for minor instruction
reorderings; see associated modifications to lit tests.

For further details on the VPlan model see docs/Proposals/VectorizationPlan.rst
and its references.

Authors: Gil Rapaport and Ayal Zaks

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-17 09:29:59 +00:00
Rui Ueyama
979a8cab62 Fix -Wunused-lambda-capture for Release build.
`I` and `this` are used only in assert or DEBUG, so they are unused
in Release build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15 17:39:35 +00:00
Ayal Zaks
745921f87f [LV] Minor savings to Sink casts to unravel first order recurrence
Two minor savings: avoid copying the SinkAfter map and avoid moving a cast if it
is not needed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15 08:32:59 +00:00
Dinar Temirbulatov
822b8dab31 [SLPVectorizer] Replace VL[0] to VL0 with assert, add propagateIRFlags extra parameter VL0,
replace E->Scalars[0] to VL0, NFCI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15 00:31:49 +00:00
Dinar Temirbulatov
86316b8f46 [SLPVectorizer] Schedule bundle with different opcodes.
This change let us schedule a bundle with different opcodes in it, for example : [ load, add, add, add ]

Reviewers: mkuper, RKSimon, ABataev, mzolotukhin, spatel, filcab

Subscribers: llvm-commits, rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-14 15:40:16 +00:00
Anna Thomas
0428548839 [LoopVectorize] Fix assertion failure in Fcmp vectorization
Summary:
When vectorizing fcmps we can trip on incorrect cast assertion when setting the
FastMathFlags after generating the vectorized FCmp.
This can happen if the FCmp can be folded to true or false directly. The fix
here is to set the FastMathFlag using the FastMathFlagBuilder *before* creating
the FCmp Instruction. This is what's done by other optimizations such as
InstCombine.
Added a test case which trips on cast assertion without this patch.

Reviewers: Ayal, mssimpso, mkuper, gilr

Reviewed by: Ayal, mssimpso

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-08 18:07:44 +00:00
Alexey Bataev
a64c8c9af1 [SLP] General improvements of SLP vectorization process.
Patch tries to improve two-pass vectorization analysis, existing in SLP vectorizer. What it does:

1. Defines key nodes, that are the vectorization roots. Previously vectorization started if StoreInst or ReturnInst is found. For now, the vectorization started for all Instructions with no users and void types (Terminators, StoreInst) + CallInsts.
2. CmpInsts, InsertElementInsts and InsertValueInsts are stored in the
array. This array is processed only after the vectorization of the
first-after-these instructions key node is finished. Vectorization goes
in reverse order to try to vectorize as much code as possible.

Reviewers: mzolotukhin, Ayal, mkuper, gilr, hfinkel, RKSimon

Subscribers: ashahid, anemet, RKSimon, mssimpso, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310260 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07 15:25:49 +00:00
Alexey Bataev
20e83eb193 Revert "[SLP] General improvements of SLP vectorization process."
This reverts commit r310255.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07 14:51:52 +00:00
Alexey Bataev
4362efa895 [SLP] General improvements of SLP vectorization process.
Summary:
Patch tries to improve two-pass vectorization analysis, existing in SLP vectorizer. What it does:
1. Defines key nodes, that are the vectorization roots. Previously vectorization started if StoreInst or ReturnInst is found. For now, the vectorization started for all Instructions with no users and void types (Terminators, StoreInst) + CallInsts.
2. CmpInsts, InsertElementInsts and InsertValueInsts are stored in the array. This array is processed only after the vectorization of the first-after-these instructions key node is finished. Vectorization goes in reverse order to try to vectorize as much code as possible.

Reviewers: mzolotukhin, Ayal, mkuper, gilr, hfinkel, RKSimon

Subscribers: ashahid, anemet, RKSimon, mssimpso, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310255 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-07 14:03:17 +00:00
Dinar Temirbulatov
f24c4662b3 [SLPVectorizer] Add extra parameter to setInsertPointAfterBundle to handle different opcodes, NFCI.
Differential Revision: https://reviews.llvm.org/D35769


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310183 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-05 18:43:52 +00:00
Matt Arsenault
c8df92092d LV: Don't insert runtime ptr checks on divergent targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 21:43:08 +00:00
Alexey Bataev
340067cec4 [SLPVectorizer] Generalize interface of functions, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 14:38:07 +00:00
Alexey Bataev
b51029d1f1 [SLP] Fix for PR31880: shuffle and vectorize repeated scalar ops on extracted elements
Summary:
Currently most of the time vectors of extractelement instructions are
treated as scalars that must be gathered into vectors. But in some
cases, like when we have extractelement instructions from single vector
with different constant indeces or from 2 vectors of the same size, we
can treat this operations as shuffle of a single vector or blending of 2
vectors.
```
define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
  %x0 = extractelement <2 x i8> %x, i32 0
  %y1 = extractelement <2 x i8> %y, i32 1
  %x0x0 = mul i8 %x0, %x0
  %y1y1 = mul i8 %y1, %y1
  %ins1 = insertelement <2 x i8> undef, i8 %x0x0, i32 0
  %ins2 = insertelement <2 x i8> %ins1, i8 %y1y1, i32 1
  ret <2 x i8> %ins2
}
```
can be converted to something like
```
define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
  %1 = shufflevector <2 x i8> %x, <2 x i8> %y, <2 x i32> <i32 0, i32 3>
  %2 = mul <2 x i8> %1, %1
  ret <2 x i8> %2
}
```
Currently this type of conversion is considered as high cost
transformation.

Reviewers: mzolotukhin, delena, mkuper, hfinkel, RKSimon

Subscribers: ashahid, RKSimon, spatel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 13:25:26 +00:00
Davide Italiano
4181790cb5 [SLPVectorizer] Unbreak the build with -Werror.
GCC was complaining about `&&` within `||` without explicit
parentheses. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31 19:14:19 +00:00
Alexey Bataev
837b97fb9a [SLP] Initial rework for min/max horizontal reduction vectorization, NFC.
Summary: All getReductionCost() functions are renamed to getArithmeticReductionCost() + added basic infrastructure to handle non-binary reduction operations.

Reviewers: spatel, mzolotukhin, Ayal, mkuper, gilr, hfinkel

Subscribers: RKSimon, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31 14:36:05 +00:00
Alexey Bataev
5a34abfe3e [Cost] Rename getReductionCost() to getArithmeticReductionCost(), NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309563 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31 14:19:32 +00:00
Ayal Zaks
343f60c4b2 [LV] Avoid redundant operations manipulating masks
The Loop Vectorizer generates redundant operations when manipulating masks:
AND with true, OR with false, compare equal to true. Instead of relying on
a subsequent pass to clean them up, this patch avoids generating them.

Use null (no-mask) to represent all-one full masks, instead of a constant
all-one vector, following the convention of masked gathers and scatters.

Preparing for a follow-up VPlan patch in which these mask manipulating
operations are modeled using recipes.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31 13:21:42 +00:00
Alexey Bataev
2976ab9c15 [SLP] Allow vectorization of the instruction from the same basic blocks only, NFC.
Summary:
After some changes in SLP vectorizer we missed some additional checks to
limit the instructions for vectorization. We should not perform analysis
of the instructions if the parent of instruction is not the same as the
parent of the first instruction in the tree or it was analyzed already.

Subscribers: mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 20:11:16 +00:00
Alexey Bataev
fb84191e18 [SLP] Outline code for the check that instruction users are part of
vectorization tree, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27 15:48:44 +00:00
Dinar Temirbulatov
cce6cac026 [SLPVectorizer] Replace E->Scalars to VL0 at vectorizeTree and move comment, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 16:02:56 +00:00
Dinar Temirbulatov
4a3583d89e [SLPVectorizer] buildTree_rec replace cast<Instruction>(VL[0]) to VL0, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 15:31:54 +00:00
Dinar Temirbulatov
e234ef0a5f [SLPVectorizer] Change canReuseExtract function parameter Opcode from unsigned to Value *, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308739 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21 13:32:36 +00:00
Ayal Zaks
e1f7499ee7 [LV] Test once if vector trip count is zero, instead of twice
Generate a single test to decide if there are enough iterations to jump to the
vectorized loop, or else go to the scalar remainder loop. This test compares the
Scalar Trip Count: if STC < VF * UF go to the scalar loop. If
requiresScalarEpilogue() holds, at-least one iteration must remain scalar; the
rest can be used to form vector iterations. So in this case the test checks
instead if (STC - 1) < VF * UF by comparing STC <= VF * UF, and going to the
scalar loop if so. Otherwise the vector loop is entered for at-least one vector
iteration.

This test covers the case where incrementing the backedge-taken count will
overflow leading to an incorrect trip count of zero. In this (rare) case we will
also avoid the vector loop and jump to the scalar loop.

This patch simplifies the existing tests and effectively removes the basic-block
originally named "min.iters.checked", leaving the single test in block
"vector.ph".

Original observation and initial patch by Evgeny Stupachenko.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 05:16:39 +00:00
Simon Pilgrim
42916d8d85 Remove unnecessary cast. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17 09:35:03 +00:00
Dinar Temirbulatov
31b76d9b4a [SLPVectorizer] Add an extra parameter to tryScheduleBundle function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308081 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 05:43:54 +00:00
Dinar Temirbulatov
4cbfb4282b [SLPVectorizer] Add an extra parameter to alreadyVectorized function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-14 03:48:29 +00:00
Michael Kuperstein
73d05a2a19 [LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions.
This fixes PR33706.
Differential Revision: https://reviews.llvm.org/D35227


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12 19:53:55 +00:00
Dinar Temirbulatov
fa3d66c27c [SLPVectorizer] Revert change in cancelScheduling with referencing to FirstInBundle, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-11 15:54:50 +00:00
Dinar Temirbulatov
18b9e001a8 [SLPVectorizer] Add an extra parameter to cancelScheduling function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 13:53:03 +00:00
Teresa Johnson
9d923b35aa Revert "r306473 - re-commit r306336: Enable vectorizer-maximize-bandwidth by default."
This still breaks PPC tests we have. I'll forward reproduction
instructions to dehao.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 03:24:09 +00:00
Teresa Johnson
f7497bfb4a re-commit r306336: Enable vectorizer-maximize-bandwidth by default.
Differential Revision: https://reviews.llvm.org/D33341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 03:24:08 +00:00
Teresa Johnson
423d09931a revert r306336 for breaking ppc test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 03:24:07 +00:00
Teresa Johnson
005cfad2e8 Enable vectorizer-maximize-bandwidth by default.
Summary:
vectorizer-maximize-bandwidth is generally useful in terms of performance. I've tested the impact of changing this to default on speccpu benchmarks on sandybridge machines. The result shows non-negative impact:

spec/2006/fp/C++/444.namd                 26.84  -0.31%
spec/2006/fp/C++/447.dealII               46.19  +0.89%
spec/2006/fp/C++/450.soplex               42.92  -0.44%
spec/2006/fp/C++/453.povray               38.57  -2.25%
spec/2006/fp/C/433.milc                   24.54  -0.76%
spec/2006/fp/C/470.lbm                    41.08  +0.26%
spec/2006/fp/C/482.sphinx3                47.58  -0.99%
spec/2006/int/C++/471.omnetpp             22.06  +1.87%
spec/2006/int/C++/473.astar               22.65  -0.12%
spec/2006/int/C++/483.xalancbmk           33.69  +4.97%
spec/2006/int/C/400.perlbench             33.43  +1.70%
spec/2006/int/C/401.bzip2                 23.02  -0.19%
spec/2006/int/C/403.gcc                   32.57  -0.43%
spec/2006/int/C/429.mcf                   40.35  +0.27%
spec/2006/int/C/445.gobmk                 26.96  +0.06%
spec/2006/int/C/456.hmmer                  24.4  +0.19%
spec/2006/int/C/458.sjeng                 27.91  -0.08%
spec/2006/int/C/462.libquantum            57.47  -0.20%
spec/2006/int/C/464.h264ref               46.52  +1.35%

geometric mean                                   +0.29%

The regression on 453.povray seems real, but is due to secondary effects as all hot functions are bit-identical with and without the flag.

I started this patch to consult upstream opinions on this. It will be greatly appreciated if the community can help test the performance impact of this change on other architectures so that we can decided if this should be target-dependent.

Reviewers: hfinkel, mkuper, davidxl, chandlerc

Reviewed By: chandlerc

Subscribers: rengolin, sanjoy, javed.absar, bjope, dorit, magabari, RKSimon, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 03:24:06 +00:00
Dinar Temirbulatov
7bf0a87e3a [SLPVectorizer] Add isOdd() helper function, NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 21:16:26 +00:00
Ayal Zaks
e050d57c74 [LV] Sink casts to unravel first order recurrence
Check if a single cast is preventing handling a first-order-recurrence Phi,
because the scheduling constraints it imposes on the first-order-recurrence
shuffle are infeasible; but they can be made feasible by moving the cast
downwards. Record such casts and move them when vectorizing the loop.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 21:05:06 +00:00
Ayal Zaks
bfae62c2cb [LV] Optimize for size when vectorizing loops with tiny trip count
It may be detrimental to vectorize loops with very small trip count, as various
costs of the vectorized loop body as well as enclosing overheads including
runtime tests and scalar iterations may outweigh the gains of vectorizing. The
current cost model measures the cost of the vectorized loop body only, expecting
it will amortize other costs, and loops with known or expected very small trip
counts are not vectorized at all. This patch allows loops with very small trip
counts to be vectorized, but under OptForSize constraints, which ensure the cost
of the loop body is dominant, having no runtime guards nor scalar iterations.

Patch inspired by D32451.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 08:02:35 +00:00
Chandler Carruth
cebf3467bc Remove the BBVectorize pass.
It served us well, helped kick-start much of the vectorization efforts
in LLVM, etc. Its time has come and past. Back in 2014:
http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html

Time to actually let go and move forward. =]

I've updated the release notes both about the removal and the
deprecation of the corresponding C API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 07:09:08 +00:00
Daniel Jasper
ed1642feee Revert "r306473 - re-commit r306336: Enable vectorizer-maximize-bandwidth by default."
This still breaks PPC tests we have. I'll forward reproduction
instructions to dehao.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 06:32:21 +00:00
Dinar Temirbulatov
d5b3cba3bb [SLPVectorizer] Moving Entry->NeedToGather check out of inner loop,
since it is invariant there. NFCI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29 21:56:33 +00:00
Dinar Temirbulatov
c0dfd2f671 [SLPVectorizer] Introducing getTreeEntry() helper function [NFC]
Differential Revision: https://reviews.llvm.org/D34756


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29 08:46:18 +00:00
Ayal Zaks
9a06b5298e [LV] Fix PR33613 - retain order of insertelement per part
r306381 caused PR33613, by reversing the order in which insertelements were
generated per unroll part. This patch fixes PR33613 by retraining this order,
placing each set of insertelements per part immediately after the last scalar
being packed for this part. Includes a test case derived from PR33613.

Reference: https://bugs.llvm.org/show_bug.cgi?id=33613
Differential Revision: https://reviews.llvm.org/D34760


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 17:59:33 +00:00
Dehao Chen
c9d2291c96 re-commit r306336: Enable vectorizer-maximize-bandwidth by default.
Differential Revision: https://reviews.llvm.org/D33341


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 22:05:58 +00:00
Ayal Zaks
84b5668c17 Recommitting 306331.
Undoing revert 306338 after fixed bug: add metadata to the load instead of the
reverse shuffle added to it, retaining the original ValueMap implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 08:41:19 +00:00
Dehao Chen
74c2abe3c6 revert r306336 for breaking ppc test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 23:05:35 +00:00
Ayal Zaks
bfc8711de9 reverting 306331.
Causes TBAA metadata to be generates on reverse shuffles, investigating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 22:26:54 +00:00