[llvm] 5877bef - [LAA] Remove unneeded findValue calls (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 31 11:19:39 PDT 2025
Author: Florian Hahn
Date: 2025-03-31T19:19:27+01:00
New Revision: 5877bef3854d5dc5eaeb308636bcc31b12240563
URL: https://github.com/llvm/llvm-project/commit/5877bef3854d5dc5eaeb308636bcc31b12240563
DIFF: https://github.com/llvm/llvm-project/commit/5877bef3854d5dc5eaeb308636bcc31b12240563.diff
LOG: [LAA] Remove unneeded findValue calls (NFC).
Use findLeader directly instead if going through findValue,
getLeaderValue. This is simpler and more efficient.
Added:
Modified:
llvm/lib/Analysis/LoopAccessAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index dd7b796fd0fdf..e7d6984caeba3 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -520,14 +520,13 @@ void RuntimePointerChecking::groupChecks(
Pointers[I].IsWritePtr);
SmallVector<RuntimeCheckingPtrGroup, 2> Groups;
- auto LeaderI = DepCands.findValue(DepCands.getLeaderValue(Access));
// Because DepCands is constructed by visiting accesses in the order in
// which they appear in alias sets (which is deterministic) and the
// iteration order within an equivalence class member is only dependent on
// the order in which unions and insertions are performed on the
// equivalence class, the iteration order is deterministic.
- for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end();
+ for (auto MI = DepCands.findLeader(Access), ME = DepCands.member_end();
MI != ME; ++MI) {
auto PointerI = PositionMap.find(MI->getPointer());
assert(PointerI != PositionMap.end() &&
@@ -2264,13 +2263,9 @@ bool MemoryDepChecker::areDepsSafe(const DepCandidates &AccessSets,
if (Visited.count(CurAccess))
continue;
- // Get the relevant memory access set.
- EquivalenceClasses<MemAccessInfo>::iterator I =
- AccessSets.findValue(AccessSets.getLeaderValue(CurAccess));
-
// Check accesses within this set.
EquivalenceClasses<MemAccessInfo>::member_iterator AI =
- AccessSets.member_begin(I);
+ AccessSets.findLeader(CurAccess);
EquivalenceClasses<MemAccessInfo>::member_iterator AE =
AccessSets.member_end();
More information about the llvm-commits
mailing list