aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorRamkumar Ramachandra <ramkumar.ramachandra@codasip.com>2025-04-04 14:34:08 +0100
committerGitHub <noreply@github.com>2025-04-04 14:34:08 +0100
commitfd6260f13bfecfb13537e184f4e8365cf35492fd (patch)
treeb815c22e48941e16c0ade6ef37e45814a0a7f3a8 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parentfb9deab74e5dc9a9227732fcd95c1aadacf86d44 (diff)
downloadllvm-fd6260f13bfecfb13537e184f4e8365cf35492fd.zip
llvm-fd6260f13bfecfb13537e184f4e8365cf35492fd.tar.gz
llvm-fd6260f13bfecfb13537e184f4e8365cf35492fd.tar.bz2
[EquivClasses] Shorten members_{begin,end} idiom (#134373)
Introduce members() iterator-helper to shorten the members_{begin,end} idiom. A previous attempt of this patch was #130319, which had to be reverted due to unit-test failures when attempting to call members() on the end iterator. In this patch, members() accepts either an ECValue or an ElemTy, which is more intuitive and doesn't suffer from the same issue.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 47ff31b..a37ed5c 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -526,9 +526,8 @@ void RuntimePointerChecking::groupChecks(
// 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.findLeader(Access), ME = DepCands.member_end();
- MI != ME; ++MI) {
- auto PointerI = PositionMap.find(MI->getPointer());
+ for (auto M : DepCands.members(Access)) {
+ auto PointerI = PositionMap.find(M.getPointer());
assert(PointerI != PositionMap.end() &&
"pointer in equivalence class not found in PositionMap");
for (unsigned Pointer : PointerI->second) {