[llvm] [SCEV] Remove unused classof(const SCEVUse *) overloads (NFC) (PR #226734)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 14:40:17 PDT 2026


https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/226734

isa/cast/dyn_cast on SCEVUse go through simplify_type or CastInfo. classof(SCEVUse) is unused.

>From afef984debcf3b37c7b5e168bdb2b85cef413190 Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo at fhahn.com>
Date: Fri, 25 Sep 2026 14:43:58 +0100
Subject: [PATCH] [SCEV] Remove unused classof(const SCEVUse *) overloads (NFC)

isa/cast/dyn_cast on SCEVUse go through simplify_type or CastInfo and
end up calling classof(const SCEV *), so the classof(const SCEVUse *)
overloads on SCEVNAryExpr, SCEVAddExpr, SCEVMulExpr and
SCEVSequentialMinMaxExpr are never used.
---
 llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 12f201f3ae50e..feb62d73079bb 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -228,7 +228,6 @@ class SCEVNAryExpr : public SCEV {
            S->getSCEVType() == scSequentialUMinExpr ||
            S->getSCEVType() == scAddRecExpr;
   }
-  static bool classof(const SCEVUse *U) { return classof(U->getPointer()); }
 };
 
 /// This node is the base class for n'ary commutative operators.
@@ -273,7 +272,6 @@ class SCEVAddExpr : public SCEVCommutativeExpr {
 public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const SCEV *S) { return S->getSCEVType() == scAddExpr; }
-  static bool classof(const SCEVUse *U) { return classof(U->getPointer()); }
 };
 
 /// This node represents multiplication of some number of SCEVs.
@@ -286,7 +284,6 @@ class SCEVMulExpr : public SCEVCommutativeExpr {
 public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const SCEV *S) { return S->getSCEVType() == scMulExpr; }
-  static bool classof(const SCEVUse *U) { return classof(U->getPointer()); }
 };
 
 /// This class represents a binary unsigned division operation.
@@ -539,7 +536,6 @@ class SCEVSequentialMinMaxExpr : public SCEVNAryExpr {
   static bool classof(const SCEV *S) {
     return isSequentialMinMaxType(S->getSCEVType());
   }
-  static bool classof(const SCEVUse *U) { return classof(U->getPointer()); }
 };
 
 /// This class represents a sequential/in-order unsigned minimum selection.



More information about the llvm-commits mailing list