From 6f732bfb7900be621bf43002105ec05da62e679a Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Tue, 16 Oct 2018 15:46:26 +0000 Subject: [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 --- llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp') diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp index 7e11504c0e0..bde90a71b41 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -817,11 +817,12 @@ bool LoopVectorizationLegality::canVectorizeMemory() { if (!LAI->canVectorizeMemory()) return false; - if (LAI->hasVariantStoreToLoopInvariantAddress()) { + if (LAI->hasMultipleStoresToLoopInvariantAddress()) { ORE->emit(createMissedAnalysis("CantVectorizeStoreToLoopInvariantAddress") - << "write of variant value to a loop invariant address could not " + << "multiple writes to a loop invariant address could not " "be vectorized"); - LLVM_DEBUG(dbgs() << "LV: We don't allow storing to uniform addresses\n"); + LLVM_DEBUG( + dbgs() << "LV: We don't allow multiple stores to a uniform address\n"); return false; } -- cgit v1.2.3