Skip to content

Commit 5877bef

Browse files
committed
[LAA] Remove unneeded findValue calls (NFC).
Use findLeader directly instead if going through findValue, getLeaderValue. This is simpler and more efficient.
1 parent 668edb4 commit 5877bef

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,13 @@ void RuntimePointerChecking::groupChecks(
520520
Pointers[I].IsWritePtr);
521521

522522
SmallVector<RuntimeCheckingPtrGroup, 2> Groups;
523-
auto LeaderI = DepCands.findValue(DepCands.getLeaderValue(Access));
524523

525524
// Because DepCands is constructed by visiting accesses in the order in
526525
// which they appear in alias sets (which is deterministic) and the
527526
// iteration order within an equivalence class member is only dependent on
528527
// the order in which unions and insertions are performed on the
529528
// equivalence class, the iteration order is deterministic.
530-
for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end();
529+
for (auto MI = DepCands.findLeader(Access), ME = DepCands.member_end();
531530
MI != ME; ++MI) {
532531
auto PointerI = PositionMap.find(MI->getPointer());
533532
assert(PointerI != PositionMap.end() &&
@@ -2264,13 +2263,9 @@ bool MemoryDepChecker::areDepsSafe(const DepCandidates &AccessSets,
22642263
if (Visited.count(CurAccess))
22652264
continue;
22662265

2267-
// Get the relevant memory access set.
2268-
EquivalenceClasses<MemAccessInfo>::iterator I =
2269-
AccessSets.findValue(AccessSets.getLeaderValue(CurAccess));
2270-
22712266
// Check accesses within this set.
22722267
EquivalenceClasses<MemAccessInfo>::member_iterator AI =
2273-
AccessSets.member_begin(I);
2268+
AccessSets.findLeader(CurAccess);
22742269
EquivalenceClasses<MemAccessInfo>::member_iterator AE =
22752270
AccessSets.member_end();
22762271

0 commit comments

Comments
 (0)