summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-12-26 23:30:53 +0000
committerNadav Rotem <nrotem@apple.com>2012-12-26 23:30:53 +0000
commit5350cd314bf775e3aca4342fb10b1ddc93a2f72e (patch)
tree7ac935024e68cb506adbe6e445418b4ed49c06d2 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parentc5573439569bea69bbaf3e41ca1b1e4f79bd5d5c (diff)
downloadbcm5719-llvm-5350cd314bf775e3aca4342fb10b1ddc93a2f72e.tar.gz
bcm5719-llvm-5350cd314bf775e3aca4342fb10b1ddc93a2f72e.zip
If all of the write objects are identified then we can vectorize the loop even if the read objects are unidentified.
PR14719. llvm-svn: 171124
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index d64295c7f72..7fb9bbada0f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud