[llvm] [SCEVPatternMatch] Strip redundant const_cast (NFC) (PR #189382)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 06:43:59 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/189382.diff


1 Files Affected:

- (modified) llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h (+1-2) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h b/llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
index 398dc7da67abc..d678e23afc18d 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
@@ -24,8 +24,7 @@ template <typename Pattern> bool match(const SCEV *S, const Pattern &P) {
 }
 
 template <typename Pattern> bool match(const SCEVUse U, const Pattern &P) {
-  const SCEV *S = U.getPointer();
-  return const_cast<Pattern &>(P).match(S);
+  return P.match(U.getPointer());
 }
 
 template <typename Predicate> struct cst_pred_ty : public Predicate {

``````````

</details>


https://github.com/llvm/llvm-project/pull/189382


More information about the llvm-commits mailing list