diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-12-26 23:30:53 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-12-26 23:30:53 +0000 |
commit | 5dd839430c1dbce6cd35dc44f68718a1fc69bfba (patch) | |
tree | 052a260851158031533a6cc3d365c75f2b3ec569 /lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | e9fd6ad5679e08c59613fc2765e8b628e5c1eb95 (diff) |
If all of the write objects are identified then we can vectorize the loop even if the read objects are unidentified.
PR14719.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index d64295c7f7..7fb9bbada0 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1704,6 +1704,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() { // Check that the read-writes do not conflict with other read-write // pointers. + bool AllWritesIdentified = true; for (I = ReadWrites.begin(), IE = ReadWrites.end(); I != IE; ++I) { GetUnderlyingObjects(*I, TempObjects, DL); for (ValueVector::iterator it=TempObjects.begin(), e=TempObjects.end(); @@ -1711,6 +1712,7 @@ bool LoopVectorizationLegality::canVectorizeMemory() { if (!isIdentifiedObject(*it)) { DEBUG(dbgs() << "LV: Found an unidentified write ptr:"<< **it <<"\n"); NeedRTCheck = true; + AllWritesIdentified = false; } if (!WriteObjects.insert(*it)) { DEBUG(dbgs() << "LV: Found a possible write-write reorder:" @@ -1726,7 +1728,9 @@ bool LoopVectorizationLegality::canVectorizeMemory() { GetUnderlyingObjects(*I, TempObjects, DL); for (ValueVector::iterator it=TempObjects.begin(), e=TempObjects.end(); it != e; ++it) { - if (!isIdentifiedObject(*it)) { + // If all of the writes are identified then we don't care if the read + // pointer is identified or not. + if (!AllWritesIdentified && !isIdentifiedObject(*it)) { DEBUG(dbgs() << "LV: Found an unidentified read ptr:"<< **it <<"\n"); NeedRTCheck = true; } |