aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-03-07 12:45:07 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-03-07 12:45:07 +0000
commitb32febe48e4ded76f515749107405d207add9ccb (patch)
tree9c01fd811a6516ca84033e5c7206271db4fe68ae /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parent40e21f2a201484045a343bd7a8ea64acf5a944fd (diff)
downloadllvm-b32febe48e4ded76f515749107405d207add9ccb.zip
llvm-b32febe48e4ded76f515749107405d207add9ccb.tar.gz
llvm-b32febe48e4ded76f515749107405d207add9ccb.tar.bz2
[memdep] Switch a function to return true on success instead of false.
This is much more clear and less surprising IMO. It also makes things more consistent with the increasingly large chunk of LLVM code that assumes true-on-success. llvm-svn: 262826
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 1e446f4..26a84a1 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -964,7 +964,7 @@ void MemoryDependenceAnalysis::getNonLocalPointerDependency(
// a block with multiple different pointers. This can happen during PHI
// translation.
DenseMap<BasicBlock *, Value *> Visited;
- if (!getNonLocalPointerDepFromBB(QueryInst, Address, Loc, isLoad, FromBB,
+ if (getNonLocalPointerDepFromBB(QueryInst, Address, Loc, isLoad, FromBB,
Result, Visited, true))
return;
Result.clear();
@@ -1089,7 +1089,7 @@ SortNonLocalDepInfoCache(MemoryDependenceAnalysis::NonLocalDepInfo &Cache,
/// is true). In this special case, it ignores the contents of the specified
/// block and starts returning dependence info for its predecessors.
///
-/// This function returns false on success, or true to indicate that it could
+/// This function returns true on success, or false to indicate that it could
/// not compute dependence information for some reason. This should be treated
/// as a clobber dependence on the first instruction in the predecessor block.
bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
@@ -1174,10 +1174,10 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
if (VI == Visited.end() || VI->second == Pointer.getAddr())
continue;
- // We have a pointer mismatch in a block. Just return clobber, saying
+ // We have a pointer mismatch in a block. Just return false, saying
// that something was clobbered in this result. We could also do a
// non-fully cached query, but there is little point in doing this.
- return true;
+ return false;
}
}
@@ -1197,7 +1197,7 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
}
}
++NumCacheCompleteNonLocalPtr;
- return false;
+ return true;
}
// Otherwise, either this is a new block, a block with an invalid cache
@@ -1243,7 +1243,7 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
// specific block queries) but we can't do the fastpath "return all
// results from the set". Clear out the indicator for this.
CacheInfo->Pair = BBSkipFirstBlockPair();
- return true;
+ return false;
}
// Skip the first block if we have it.
@@ -1395,7 +1395,7 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
// result conflicted with the Visited list; we have to conservatively
// assume it is unknown, but this also does not block PRE of the load.
if (!CanTranslate ||
- getNonLocalPointerDepFromBB(QueryInst, PredPointer,
+ !getNonLocalPointerDepFromBB(QueryInst, PredPointer,
Loc.getWithNewPtr(PredPtrVal), isLoad,
Pred, Result, Visited)) {
// Add the entry to the Result list.
@@ -1450,7 +1450,7 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
// incoming value. Since we can't phi translate to one of the predecessors,
// we have to bail out.
if (SkipFirstBlock)
- return true;
+ return false;
bool foundBlock = false;
for (NonLocalDepEntry &I : llvm::reverse(*Cache)) {
@@ -1473,7 +1473,7 @@ bool MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(
// Okay, we're done now. If we added new values to the cache, re-sort it.
SortNonLocalDepInfoCache(*Cache, NumSortedEntries);
DEBUG(AssertSorted(*Cache));
- return false;
+ return true;
}
/// If P exists in CachedNonLocalPointerInfo, remove it.