[EquivalenceClasses] Replace findValue with contains (NFC).

Replace remaining use of findValue with more compact and limited
contains().
This commit is contained in:
Florian Hahn
2025-03-31 20:11:00 +01:00
parent b46c60272e
commit 8e390dedd7
2 changed files with 4 additions and 5 deletions

View File

@@ -179,10 +179,9 @@ public:
return member_iterator(nullptr);
}
/// findValue - Return an iterator to the specified value. If it does not
/// exist, end() is returned.
iterator findValue(const ElemTy &V) const {
return TheMapping.find(V);
/// Returns true if \p V is contained an equivalence class.
bool contains(const ElemTy &V) const {
return TheMapping.find(V) != TheMapping.end();
}
/// getLeaderValue - Return the leader for the specified value that is in the

View File

@@ -1230,7 +1230,7 @@ bool AccessAnalysis::canCheckPtrAtRT(
[this](const Value *Ptr) {
MemAccessInfo AccessWrite(const_cast<Value *>(Ptr),
true);
return DepCands.findValue(AccessWrite) == DepCands.end();
return !DepCands.contains(AccessWrite);
})) &&
"Can only skip updating CanDoRT below, if all entries in AS "
"are reads or there is at most 1 entry");