From 62b03e344eeb168d0ac87a442275b28d3e95016a Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Wed, 20 Jul 2016 20:07:34 +0000 Subject: [LSV] Vectorize up to side-effecting instructions. Summary: Previously if we had a chain that contained a side-effecting instruction, we wouldn't vectorize it at all. Now we'll vectorize everything that comes before the side-effecting instruction. Reviewers: asbirlea Subscribers: arsenm, jholewinski, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D22536 llvm-svn: 276170 --- llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp') diff --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp index ec3e734184a..674c451f640 100644 --- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp @@ -439,13 +439,10 @@ ArrayRef Vectorizer::getVectorizablePrefix(ArrayRef Chain) { ChainInstrs.push_back({&I, InstrIdx}); } else if (I.mayHaveSideEffects()) { DEBUG(dbgs() << "LSV: Found side-effecting operation: " << I << '\n'); - return 0; + break; } } - assert(Chain.size() == ChainInstrs.size() && - "All instrs in Chain must be within range getBoundaryInstrs(Chain)."); - // Loop until we find an instruction in ChainInstrs that we can't vectorize. unsigned ChainInstrIdx, ChainInstrsLen; for (ChainInstrIdx = 0, ChainInstrsLen = ChainInstrs.size(); @@ -479,7 +476,6 @@ ArrayRef Vectorizer::getVectorizablePrefix(ArrayRef Chain) { DEBUG({ Value *Ptr0 = getPointerOperand(M0); Value *Ptr1 = getPointerOperand(M1); - dbgs() << "LSV: Found alias:\n" " Aliasing instruction and pointer:\n" << " " << *MemInstr << '\n' @@ -713,7 +709,7 @@ bool Vectorizer::vectorizeStoreChain( ArrayRef NewChain = getVectorizablePrefix(Chain); if (NewChain.empty()) { - // There exists a side effect instruction, no vectorization possible. + // No vectorization possible. InstructionsProcessed->insert(Chain.begin(), Chain.end()); return false; } @@ -867,7 +863,7 @@ bool Vectorizer::vectorizeLoadChain( ArrayRef NewChain = getVectorizablePrefix(Chain); if (NewChain.empty()) { - // There exists a side effect instruction, no vectorization possible. + // No vectorization possible. InstructionsProcessed->insert(Chain.begin(), Chain.end()); return false; } -- cgit v1.2.3