Skip to content

Commit 8e390de

Browse files
committed
[EquivalenceClasses] Replace findValue with contains (NFC).
Replace remaining use of findValue with more compact and limited contains().
1 parent b46c602 commit 8e390de

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/include/llvm/ADT/EquivalenceClasses.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,9 @@ class EquivalenceClasses {
179179
return member_iterator(nullptr);
180180
}
181181

182-
/// findValue - Return an iterator to the specified value. If it does not
183-
/// exist, end() is returned.
184-
iterator findValue(const ElemTy &V) const {
185-
return TheMapping.find(V);
182+
/// Returns true if \p V is contained an equivalence class.
183+
bool contains(const ElemTy &V) const {
184+
return TheMapping.find(V) != TheMapping.end();
186185
}
187186

188187
/// getLeaderValue - Return the leader for the specified value that is in the

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ bool AccessAnalysis::canCheckPtrAtRT(
12301230
[this](const Value *Ptr) {
12311231
MemAccessInfo AccessWrite(const_cast<Value *>(Ptr),
12321232
true);
1233-
return DepCands.findValue(AccessWrite) == DepCands.end();
1233+
return !DepCands.contains(AccessWrite);
12341234
})) &&
12351235
"Can only skip updating CanDoRT below, if all entries in AS "
12361236
"are reads or there is at most 1 entry");

0 commit comments

Comments
 (0)