aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index cf3bb6a..38ee82b 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1362,8 +1362,10 @@ void AccessAnalysis::processMemAccesses() {
bool SetHasWrite = false;
- // Map of pointers to last access encountered.
- typedef DenseMap<const Value*, MemAccessInfo> UnderlyingObjToAccessMap;
+ // Map of (pointer to underlying objects, accessed address space) to last
+ // access encountered.
+ typedef DenseMap<std::pair<const Value *, unsigned>, MemAccessInfo>
+ UnderlyingObjToAccessMap;
UnderlyingObjToAccessMap ObjToLastAccess;
// Set of access to check after all writes have been processed.
@@ -1443,8 +1445,10 @@ void AccessAnalysis::processMemAccesses() {
UnderlyingObj->getType()->getPointerAddressSpace()))
continue;
- auto [It, Inserted] =
- ObjToLastAccess.try_emplace(UnderlyingObj, Access);
+ auto [It, Inserted] = ObjToLastAccess.try_emplace(
+ {UnderlyingObj,
+ cast<PointerType>(Ptr->getType())->getAddressSpace()},
+ Access);
if (!Inserted) {
DepCands.unionSets(Access, It->second);
It->second = Access;