diff options
author | Anna Thomas <anna@azul.com> | 2018-11-19 15:39:59 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2018-11-19 15:39:59 +0000 |
commit | 5e9215f02bc54f89148da065e40948fbd038a2c4 (patch) | |
tree | 1eaa4dd24264f27c4662669ecae046ebf5613f65 /llvm/lib/Transforms | |
parent | 8a063df19435af25eadd30734be1b76275cbb56b (diff) | |
download | bcm5719-llvm-5e9215f02bc54f89148da065e40948fbd038a2c4.tar.gz bcm5719-llvm-5e9215f02bc54f89148da065e40948fbd038a2c4.zip |
[LV] Avoid vectorizing unsafe dependencies in uniform address
Summary:
Currently, when vectorizing stores to uniform addresses, the only
instance we prevent vectorization is if there are multiple stores to the
same uniform address causing an unsafe dependency.
This patch teaches LAA to avoid vectorizing loops that have an unsafe
cross-iteration dependency between a load and a store to the same uniform address.
Fixes PR39653.
Reviewers: Ayal, efriedma
Subscribers: rkruppe, llvm-commits
Differential Revision: https://reviews.llvm.org/D54538
llvm-svn: 347220
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp index 755ad32a7bf..36f1cbd36d9 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -817,15 +817,14 @@ bool LoopVectorizationLegality::canVectorizeMemory() { if (!LAI->canVectorizeMemory()) return false; - if (LAI->hasMultipleStoresToLoopInvariantAddress()) { + if (LAI->hasDependenceInvolvingLoopInvariantAddress()) { ORE->emit(createMissedAnalysis("CantVectorizeStoreToLoopInvariantAddress") - << "multiple writes to a loop invariant address could not " + << "write to a loop invariant address could not " "be vectorized"); LLVM_DEBUG( - dbgs() << "LV: We don't allow multiple stores to a uniform address\n"); + dbgs() << "LV: Non vectorizable stores to a uniform address\n"); return false; } - Requirements->addRuntimePointerChecks(LAI->getNumRuntimePointerChecks()); PSE.addPredicate(LAI->getPSE().getUnionPredicate()); |