[llvm] [NFC][LLVM] Namespace cleanup in SCCPSolver (PR #180245)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 6 09:46:36 PST 2026
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/180245
None
>From 46c46bb3951ec83fe0d7aa6ea76f813dc0d0f9f2 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Fri, 6 Feb 2026 09:31:51 -0800
Subject: [PATCH] [NFC][LLVM] Namespace cleanup in SCCPSolver
---
llvm/lib/Transforms/Utils/SCCPSolver.cpp | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/llvm/lib/Transforms/Utils/SCCPSolver.cpp b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
index 0ac99413a2cf8..019c866caa0c6 100644
--- a/llvm/lib/Transforms/Utils/SCCPSolver.cpp
+++ b/llvm/lib/Transforms/Utils/SCCPSolver.cpp
@@ -50,8 +50,6 @@ static ValueLatticeElement::MergeOptions getMaxWidenStepsOpts() {
MaxNumRangeExtensions);
}
-namespace llvm {
-
bool SCCPSolver::isConstant(const ValueLatticeElement &LV) {
return LV.isConstant() ||
(LV.isConstantRange() && LV.getConstantRange().isSingleElement());
@@ -239,9 +237,9 @@ static bool replaceSignedInst(SCCPSolver &Solver,
}
/// Try to use \p Inst's value range from \p Solver to simplify it.
-static Value *simplifyInstruction(SCCPSolver &Solver,
- SmallPtrSetImpl<Value *> &InsertedValues,
- Instruction &Inst) {
+static Value *simplifyAnInstruction(SCCPSolver &Solver,
+ SmallPtrSetImpl<Value *> &InsertedValues,
+ Instruction &Inst) {
auto GetRange = [&Solver, &InsertedValues](Value *Op) {
return getRange(Op, Solver, InsertedValues);
};
@@ -366,7 +364,7 @@ bool SCCPSolver::simplifyInstsInBlock(BasicBlock &BB,
++InstReplacedStat;
} else if (refineInstruction(*this, InsertedValues, Inst)) {
MadeChanges = true;
- } else if (auto *V = simplifyInstruction(*this, InsertedValues, Inst)) {
+ } else if (auto *V = simplifyAnInstruction(*this, InsertedValues, Inst)) {
Inst.replaceAllUsesWith(V);
Inst.eraseFromParent();
++InstRemovedStat;
@@ -517,7 +515,7 @@ void SCCPSolver::inferArgAttributes() const {
/// Helper class for SCCPSolver. This implements the instruction visitor and
/// holds all the state.
-class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
+class llvm::SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
const DataLayout &DL;
std::function<const TargetLibraryInfo &(Function &)> GetTLI;
/// Basic blocks that are executable (but may not have been visited yet).
@@ -1031,8 +1029,6 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
}
};
-} // namespace llvm
-
bool SCCPInstVisitor::markBlockExecutable(BasicBlock *BB) {
if (!BBExecutable.insert(BB).second)
return false;
More information about the llvm-commits
mailing list