summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorAnna Thomas <anna@azul.com>2018-10-16 15:46:26 +0000
committerAnna Thomas <anna@azul.com>2018-10-16 15:46:26 +0000
commit6f732bfb7900be621bf43002105ec05da62e679a (patch)
treeb2e4f5250099752d2d474107db6b431e9bda0603 /llvm/lib/Analysis
parentbb3dd34e62d2b53402a84d9d8b2a3c865fdf43fd (diff)
downloadbcm5719-llvm-6f732bfb7900be621bf43002105ec05da62e679a.tar.gz
bcm5719-llvm-6f732bfb7900be621bf43002105ec05da62e679a.zip
[LV] Teach vectorizer about variant value store into uniform address
Summary: Teach vectorizer about vectorizing variant value stores to uniform address. Similar to rL343028, we do not allow vectorization if we have multiple stores to the same uniform address. Cost model already has the change for considering the extract instruction cost for a variant value store. See added test cases for how vectorization is done. The patch also contains changes to the ORE messages. Reviewers: Ayal, mkuper, anemet, hsaito Subscribers: rkruppe, llvm-commits Differential Revision: https://reviews.llvm.org/D52656 llvm-svn: 344613
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index b43e290956d..4b8e8afdabb 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1869,13 +1869,9 @@ void LoopAccessInfo::analyzeLoop(AliasAnalysis *AA, LoopInfo *LI,
for (StoreInst *ST : Stores) {
Value *Ptr = ST->getPointerOperand();
- if (isUniform(Ptr)) {
- // Consider multiple stores to the same uniform address as a store of a
- // variant value.
- bool MultipleStoresToUniformPtr = !UniformStores.insert(Ptr).second;
- HasVariantStoreToLoopInvariantAddress |=
- (!isUniform(ST->getValueOperand()) || MultipleStoresToUniformPtr);
- }
+ if (isUniform(Ptr))
+ HasMultipleStoresToLoopInvariantAddress |=
+ !UniformStores.insert(Ptr).second;
// If we did *not* see this pointer before, insert it to the read-write
// list. At this phase it is only a 'write' list.
@@ -2276,7 +2272,7 @@ LoopAccessInfo::LoopAccessInfo(Loop *L, ScalarEvolution *SE,
PtrRtChecking(llvm::make_unique<RuntimePointerChecking>(SE)),
DepChecker(llvm::make_unique<MemoryDepChecker>(*PSE, L)), TheLoop(L),
NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1), CanVecMem(false),
- HasVariantStoreToLoopInvariantAddress(false) {
+ HasMultipleStoresToLoopInvariantAddress(false) {
if (canAnalyzeLoop())
analyzeLoop(AA, LI, TLI, DT);
}
@@ -2308,8 +2304,8 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const {
PtrRtChecking->print(OS, Depth);
OS << "\n";
- OS.indent(Depth) << "Variant Store to invariant address was "
- << (HasVariantStoreToLoopInvariantAddress ? "" : "not ")
+ OS.indent(Depth) << "Multiple stores to invariant address were "
+ << (HasMultipleStoresToLoopInvariantAddress ? "" : "not ")
<< "found in loop.\n";
OS.indent(Depth) << "SCEV assumptions:\n";
OpenPOWER on IntegriCloud