1749 Commits

Author SHA1 Message Date
Simon Pilgrim
f2aa921cfe [LoopVectorize] Don't dereference a dyn_cast result. NFCI.
The static analyzer is warning about potential null dereferences of dyn_cast<> results, we can use cast<> directly as we know that these cases should all be CastInst, which is why its working atm and anyway cast<> will assert if they aren't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 13:24:54 +00:00
Simon Pilgrim
f4c41d6cba [VPlanSLP] Don't dereference a cast_or_null<VPInstruction> result. NFCI.
The static analyzer is warning about a potential null dereference of the cast_or_null result, I've split the cast_or_null check from the ->getUnderlyingInstr() call to avoid this, but it appears that we weren't seeing any null pointers in the dumped bundles in the first place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371975 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 11:22:44 +00:00
Simon Pilgrim
5a41182176 [SLPVectorizer] Assert that we find a LastInst to silence analyzer null dereference warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371974 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 10:48:16 +00:00
Simon Pilgrim
c46379da2c [SLPVectorizer] Don't dereference a dyn_cast result. NFCI.
The static analyzer is warning about potential null dereferences of dyn_cast<> results - in these cases we can safely use cast<> directly as we know that these cases should all be the correct type, which is why its working atm and anyway cast<> will assert if they aren't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371973 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 10:35:09 +00:00
Simon Pilgrim
81bcd7a858 [LoadStoreVectorizer] vectorizeLoadChain - ensure we find a valid Type down the load chain. NFCI.
Silence static analyzer uninitialized variable warning by setting the LoadTy to null and then asserting we find a real value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371936 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15 16:44:35 +00:00
Sanjay Patel
71f28d66dd [SLP] limit vectorization of Constant subclasses (PR33958)
This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=33958

It seems universally true that we would not want to transform this kind of
sequence on any target, but if that's not correct, then we could view this
as a target-specific cost model problem. We could also white-list ConstantInt,
ConstantFP, etc. rather than blacklist Global and ConstantExpr.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371931 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-15 13:03:24 +00:00
Philip Reames
ed0d1bcf30 [Loads] Move generic code out of vectorizer into a location it might be reused [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371558 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 21:33:53 +00:00
Philip Reames
faad45dd30 [ValueTracking] Factor our common speculation suppression logic [NFC]
Expose a utility function so that all places which want to suppress speculation (when otherwise legal) due to ordering and/or sanitizer interaction can do so.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371556 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 21:12:29 +00:00
Philip Reames
33ce8a44c1 [LoopVectorize] Leverage speculation safety to avoid masked.loads
If we're vectorizing a load in a predicated block, check to see if the load can be speculated rather than predicated.  This allows us to generate a normal vector load instead of a masked.load.

To do so, we must prove that all bytes accessed on any iteration of the original loop are dereferenceable, and that all loads (across all iterations) are properly aligned.  This is equivelent to proving that hoisting the load into the loop header in the original scalar loop is safe.

Note: There are a couple of code motion todos in the code.  My intention is to wait about a day - to be sure this sticks - and then perform the NFC motion without furthe review.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371452 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-09 20:54:13 +00:00
Simon Pilgrim
29a7460729 Fix typo. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371317 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 18:09:09 +00:00
Teresa Johnson
ef512ca8e6 Change TargetLibraryInfo analysis passes to always require Function
Summary:
This is the first change to enable the TLI to be built per-function so
that -fno-builtin* handling can be migrated to use function attributes.
See discussion on D61634 for background. This is an enabler for fixing
handling of these options for LTO, for example.

This change should not affect behavior, as the provided function is not
yet used to build a specifically per-function TLI, but rather enables
that migration.

Most of the changes were very mechanical, e.g. passing a Function to the
legacy analysis pass's getTLI interface, or in Module level cases,
adding a callback. This is similar to the way the per-function TTI
analysis works.

There was one place where we were looking for builtins but not in the
context of a specific function. See FindCXAAtExit in
lib/Transforms/IPO/GlobalOpt.cpp. I'm somewhat concerned my workaround
could provide the wrong behavior in some corner cases. Suggestions
welcome.

Reviewers: chandlerc, hfinkel

Subscribers: arsenm, dschuff, jvesely, nhaehnle, mehdi_amini, javed.absar, sbc100, jgravelle-google, eraman, aheejin, steven_wu, george.burgess.iv, dexonsmith, jfb, asbirlea, gchatelet, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371284 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 03:09:36 +00:00
Guillaume Chatelet
3ad084e5dd [LLVM][Alignment] Convert isLegalNTStore/isLegalNTLoad to llvm::Align
Summary:
This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371063 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 13:09:42 +00:00
Philip Reames
8c4f5a3e13 [NFC] Switch last couple of invariant_load checks to use hasMetadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370948 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 18:27:31 +00:00
Bjorn Pettersson
b915bf3d8a [LV] Fix miscompiles by adding non-header PHI nodes to AllowedExit
Summary:
Fold-tail currently supports reduction last-vector-value live-out's,
but has yet to support last-scalar-value live-outs, including
non-header phi's. As it relies on AllowedExit in order to detect
them and bail out we need to add the non-header PHI nodes to
AllowedExit, otherwise we end up with miscompiles.

Solves https://bugs.llvm.org/show_bug.cgi?id=43166

Reviewers: fhahn, Ayal

Reviewed By: fhahn, Ayal

Subscribers: anna, hiraditya, rkruppe, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370721 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 09:33:55 +00:00
Sjoerd Meijer
ba9e6a642f [LV] Tail-folding, runtime scev checks
Now that we allow tail-folding, not only when we optimise for size, make
sure we do not run in this assert.

Differential revision: https://reviews.llvm.org/D66932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370711 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 08:53:02 +00:00
Sjoerd Meijer
8103f963ba [LV] Tail-folding with runtime memory checks
The loop vectorizer was running in an assert when it tried to fold the tail and
had to emit runtime memory disambiguation checks.

Differential revision: https://reviews.llvm.org/D66803

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370707 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 08:38:24 +00:00
Simon Pilgrim
b08e0a213e Fix cppcheck shadow variable and variable scope warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370580 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-31 12:30:19 +00:00
Ayal Zaks
cbb4ef7bbf [LV] Fold tail by masking - handle reductions
Allow vectorizing loops that have reductions when tail is folded by masking.
A select is introduced in VPlan, choosing between the last value carried by the
loop-exit/live-out instruction of the reduction, and the penultimate value
carried by the reduction phi, according to the "i < n" mask of fold-tail.
This select replaces the last value as the live-out value of the loop.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370173 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 09:02:23 +00:00
Philip Reames
8b428d2c36 Add a clarify comment for meaning of SafePointes [NFC]
Extracted from D66688 as requested.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369962 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 20:48:35 +00:00
Sanjay Patel
cca8d38975 [SLP] use range-for loops, fix formatting; NFC
These are part of D57059, but that patch doesn't apply cleanly to trunk
at this point, so we might as well remove some of the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369776 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 16:22:32 +00:00
Sanjay Patel
d28f7232b4 [SLP] fix formatting; NFC
These are part of D57059, but that patch doesn't apply cleanly to trunk
at this point, so we might as well remove some of the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 15:26:12 +00:00
Dinar Temirbulatov
7b7296ee2b [SLP][NFC] Avoid repetitive calls to getSameOpcode()
We can avoid repetitive calls getSameOpcode() for already known tree elements by keeping MainOp and AltOp in TreeEntry.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369315 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 00:22:04 +00:00
Sanjay Patel
e5efd69031 [SLP] reduce duplicated code; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369250 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 11:39:56 +00:00
Vasileios Porpodas
1a7bc073dc [SLPVectorizer] Make the scheduler aware of the TreeEntry operands.
Summary:
The scheduler's dependence graph gets the use-def dependencies by accessing the operands of the instructions in a bundle. However, buildTree_rec() may change the order of the operands in TreeEntry, and the scheduler is currently not aware of this. This is not causing any functional issues currently, because reordering is restricted to the operands of a single instruction. Once we support operand reordering across multiple TreeEntries, as shown here: http://www.llvm.org/devmtg/2019-04/slides/Poster-Porpodas-Supernode_SLP.pdf , the scheduler will need to get the correct operands from TreeEntry and not from the individual instructions.

In short, this patch:
- Connects the scheduler's bundle with the corresponding TreeEntry. It introduces new TE and Lane fields in ScheduleData.
- Moves the location where the operands of the TreeEntry are initialized. This used to take place in newTreeEntry() setting one operand at a time, but is now moved pre-order just before the recursion of buildTree_rec(). This is required because the scheduler needs to access both operands of the TreeEntry in tryScheduleBundle().
- Updates the scheduler to access the instruction operands through the TreeEntry operands instead of accessing the instruction operands directly.

Reviewers: ABataev, RKSimon, dtemirbulatov, Ayal, dorit, hfinkel

Reviewed By: ABataev

Subscribers: hiraditya, llvm-commits, lebedev.ri, rcorcs

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369131 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 17:21:18 +00:00
Simon Pilgrim
7f0eaaa700 [SLPVectorizer] Silence null dereference warning. NFCI.
cppcheck + MSVC analyzer both over zealously warn that we might dereference a null Bundle pointer - add an assertion to check for null to silence the warning, plus its a good idea to check that we succeeded in finding a schedule bundle anyway....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369094 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-16 10:28:23 +00:00
Jonas Devlieghere
114087caa6 [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369013 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 15:54:37 +00:00
Dorit Nuzman
ecfc353229 [LV] fold-tail predication should be respected even with assume_safety
assume_safety implies that loads under "if's" can be safely executed
speculatively (unguarded, unmasked). However this assumption holds only for the
original user "if's", not those introduced by the compiler, such as the
fold-tail "if" that guards us from loading beyond the original loop trip-count.
Currently the combination of fold-tail and assume-safety pragmas results in
ignoring the fold-tail predicate that guards the loads, generating unmasked
loads. This patch fixes this behavior.

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

Reviewers: Ayal, hsaito, fhahn



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368973 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 07:12:14 +00:00
Dinar Temirbulatov
2c37331f5c [SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368906 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 19:46:50 +00:00
Dorit Nuzman
6c9a51ee41 [LV] Fold-tail flag
This is the compiler-flag equivalent of the Predicate pragma
(https://reviews.llvm.org/D65197), to direct the vectorizer to fold the
remainder-loop into the main-loop using predication.

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

Reviewers: Ayal, hsaito, fhahn, SjoerdMeije



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368801 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 05:22:20 +00:00
Craig Topper
5a370c1ad8 [LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count that is less than VF*interleave
If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it.

Improves one of the cases from PR42674

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368215 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 21:44:14 +00:00
Mitch Phillips
7e7625f30a Revert "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."
This reverts commit fc33e33776b7a7ce22e539f0ec2e3bfdb09ad361.

This commit depends on the rolled back commit rL367901, and thus needs
to be rolled back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368109 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 23:38:14 +00:00
Craig Topper
49b912b85e [X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors.
With the switch to widening legalization, we need to a better
job of costing extractions of less than 128-bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368081 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 20:12:41 +00:00
Hideki Saito
057a373e1c [LV][NFC] Share the LV illegality reporting with LoopVectorize.
Reviewers: hsaito, fhahn, rengolin
 
Reviewed By: rengolin
 
Patch by psamolysov, thanks!
 
Differential Revision: https://reviews.llvm.org/D62997



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367980 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 06:08:48 +00:00
Stanislav Mekhanoshin
c39a6e682d Handle casts changing pointer size in the vectorizer
Added code to truncate or shrink offsets so that we can continue
base pointer search if size has changed along the way.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367646 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 04:03:37 +00:00
Stanislav Mekhanoshin
20db74f2d6 Relax load store vectorizer pointer strip checks
The previous change to fix crash in the vectorizer introduced
performance regressions. The condition to preserve pointer
address space during the search is too tight, we only need to
match the size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367624 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 22:18:56 +00:00
Sjoerd Meijer
ad60f4fbf4 Follow up of rL367592, fix the build
Some buildbots complained about:
error: default label in switch which covers all enumeration values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367603 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 18:54:29 +00:00
Sjoerd Meijer
d527e64640 [LV] Tail-Loop Folding
This allows folding of the scalar epilogue loop (the tail) into the main
vectorised loop body when the loop is annotated with a "vector predicate"
metadata hint. To fold the tail, instructions need to be predicated (masked),
enabling/disabling lanes for the remainder iterations.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367592 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 18:21:44 +00:00
Stanislav Mekhanoshin
e7d1432306 [AMDGPU] Fix for vectorizer crash with pointers of different size
When vectorizer strips pointers it can eventually end up with
pointers of two different sizes, then SCEV will crash.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367443 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-31 16:33:11 +00:00
Sjoerd Meijer
72855fc09a [LV] Scalar Epilogue Lowering. NFC.
This refactors boolean 'OptForSize' that was passed around in a lot of places.
It controlled folding of the tail loop, the scalar epilogue, into the main loop
but code-size reasons may not be the only reason to do this. Thus, this is a
first step to generalise the concept of tail-loop folding, and hence OptForSize
has been renamed and is using an enum ScalarEpilogueStatus that holds the
status how the epilogue should be lowered.

This will be followed up by D65197, that picks up the predicate loop hint and
performs the tail-loop folding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366993 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-25 08:06:02 +00:00
Simon Pilgrim
04215ede01 [SLPVectorizer] Revert local change that got accidently got committed in rL366799
This wasn't part of D63281

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366807 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-23 13:42:01 +00:00
Simon Pilgrim
c0664972a0 [TargetLowering] Add SimplifyMultipleUseDemandedBits
This patch introduces the DAG version of SimplifyMultipleUseDemandedBits, which attempts to peek through ops (mainly and/or/xor so far) that don't contribute to the demandedbits/elts of a node - which means we can do this even in cases where we have multiple uses of an op, which normally requires us to demanded all bits/elts. The intention is to remove a similar instruction - SelectionDAG::GetDemandedBits - once SimplifyMultipleUseDemandedBits has matured.

The InstCombine version of SimplifyMultipleUseDemandedBits can constant fold which I haven't added here yet, and so far I've only wired this up to some basic binops (and/or/xor/add/sub/mul) to demonstrate its use.

We do see a couple of regressions that need to be addressed:

    AMDGPU unsigned dot product codegen retains an AND mask (for ZERO_EXTEND) that it previously removed (but otherwise the dotproduct codegen is a lot better).
	
    X86/AVX2 has poor handling of vector ANY_EXTEND/ANY_EXTEND_VECTOR_INREG - it prematurely gets converted to ZERO_EXTEND_VECTOR_INREG.

The code owners have confirmed its ok for these cases to fixed up in future patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366799 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-23 12:39:08 +00:00
Simon Pilgrim
63ec074d6e [SLPVectorizer] Remove null-pointer test. NFCI.
cast<CallInst> shouldn't return null and we dereference the pointer in a lot of other places, causing both MSVC + cppcheck to warn about dereferenced null pointers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366793 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-23 10:51:43 +00:00
Simon Pilgrim
40d7e3f30b [SLPVectorizer] Fix some MSVC/cppcheck uninitialized variable warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366712 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-22 17:57:36 +00:00
Eric Christopher
88564d2f3a Temporarily Revert "[SLP] Recommit: Look-ahead operand reordering heuristic."
As there are some reported miscompiles with AVX512 and performance regressions
in Eigen. Verified with the original committer and testcases will be forthcoming.

This reverts commit r364964.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366154 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 23:36:02 +00:00
Florian Hahn
bbc7752ec4 [LoopVectorize] Pass unfiltered list of arguments to getIntrinsicInstCost.
We do not compute the scalarization overhead in getVectorIntrinsicCost
and TTI::getIntrinsicInstrCost requires the full arguments list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-15 08:48:47 +00:00
Florian Hahn
3748d783e0 [LV] Exclude loop-invariant inputs from scalar cost computation.
Loop invariant operands do not need to be scalarized, as we are using
the values outside the loop. We should ignore them when computing the
scalarization overhead.

Fixes PR41294

Reviewers: hsaito, rengolin, dcaballe, Ayal

Reviewed By: Ayal

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366030 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-14 20:12:36 +00:00
Fangrui Song
727b16e096 Delete dead stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365903 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-12 14:58:15 +00:00
Nikita Popov
b3ee0ad2c3 [SLP] Optimize getSpillCost(); NFCI
For a given set of live values, the spill cost will always be the
same for each call. Compute the cost once and multiply it by the
number of calls.

(I'm not sure this spill cost modeling makes sense if there are
multiple calls, as the spill cost will likely be shared across
calls in that case. But that's how it currently works.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365552 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 20:24:44 +00:00
Vasileios Porpodas
7ea3099c0c [SLP] Recommit: Look-ahead operand reordering heuristic.
Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: hiraditya, phosek, rnk, rcorcs, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364964 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-02 20:20:28 +00:00
Jordan Rupprecht
5cc6baa230 Revert [SLP] Look-ahead operand reordering heuristic.
This reverts r364478 (git commit 574cb0eb3a7ac95e62d223a60bef891171dfe321)

The patch is causing compilation timeouts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364846 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-01 21:10:43 +00:00