[llvm] [LAA] Remove unused functions (NFC) (PR #226733)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 26 14:17:07 PDT 2026
https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/226733
Remove RuntimePointerChecking::empty and LoopAccessInfo::getNumLoads / getNumStores, which have no callers, together with the NumLoads and NumStores counters that were only read by the latter.
>From b3a8a1ca0aeaf3acf5bf36703704c9d51933cd74 Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo at fhahn.com>
Date: Fri, 25 Sep 2026 11:29:49 +0100
Subject: [PATCH] [LAA] Remove unused functions (NFC)
Remove RuntimePointerChecking::empty and LoopAccessInfo::getNumLoads /
getNumStores, which have no callers, together with the NumLoads and
NumStores counters that were only read by the latter.
---
llvm/include/llvm/Analysis/LoopAccessAnalysis.h | 9 ---------
llvm/lib/Analysis/LoopAccessAnalysis.cpp | 2 --
2 files changed, 11 deletions(-)
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
index 792b8ba9cabc5..0e5f5a1e81b77 100644
--- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -598,9 +598,6 @@ class RuntimePointerChecking {
unsigned ASId, PredicatedScalarEvolution &PSE,
bool NeedsFreeze);
- /// No run-time memory checking is necessary.
- bool empty() const { return Pointers.empty(); }
-
/// Generate the checks and store it. This also performs the grouping
/// of pointers to reduce the number of memchecks necessary.
LLVM_ABI void generateChecks(MemoryDepChecker::DepCandidates &DepCands);
@@ -770,9 +767,6 @@ class LoopAccessInfo {
/// Returns true if value \p V is loop invariant.
LLVM_ABI bool isInvariant(Value *V) const;
- unsigned getNumStores() const { return NumStores; }
- unsigned getNumLoads() const { return NumLoads;}
-
/// The diagnostics report generated for the analysis. E.g. why we
/// couldn't analyze the loop.
const OptimizationRemarkAnalysis *getReport() const { return Report.get(); }
@@ -874,9 +868,6 @@ class LoopAccessInfo {
/// memory accesses could be analyzed.
bool AllowPartial;
- unsigned NumLoads = 0;
- unsigned NumStores = 0;
-
/// Cache the result of analyzeLoop.
bool CanVecMem = false;
bool HasConvergentOp = false;
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 409d9ceb5b812..804ffe5bb2edd 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2789,7 +2789,6 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
HasComplexMemInst = true;
continue;
}
- NumLoads++;
Loads.push_back(Ld);
DepChecker->addAccess(Ld);
if (EnableMemAccessVersioningOfLoop)
@@ -2813,7 +2812,6 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
HasComplexMemInst = true;
continue;
}
- NumStores++;
Stores.push_back(St);
DepChecker->addAccess(St);
if (EnableMemAccessVersioningOfLoop)
More information about the llvm-commits
mailing list