[llvm] [PowerPC] Remove a redundant cast (NFC) (PR #165834)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 30 23:17:52 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/165834

PtrValue is already of type Value *.


>From 84b17eb22135299a8a3133c05cd0dbd81099513f Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 29 Oct 2025 23:08:53 -0700
Subject: [PATCH] [PowerPC] Remove a redundant cast (NFC)

PtrValue is already of type Value *.
---
 llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 3640d2545b5ac..70df59d01d6c7 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -1316,7 +1316,7 @@ bool PPCLoopInstrFormPrep::runOnLoop(Loop *L) {
     // useless and possible to break some original well-form addressing mode
     // to make this pre-inc prep for it.
     if (PointerElementType->isIntegerTy(64)) {
-      const SCEV *LSCEV = SE->getSCEVAtScope(const_cast<Value *>(PtrValue), L);
+      const SCEV *LSCEV = SE->getSCEVAtScope(PtrValue, L);
       const SCEVAddRecExpr *LARSCEV = dyn_cast<SCEVAddRecExpr>(LSCEV);
       if (!LARSCEV || LARSCEV->getLoop() != L)
         return false;



More information about the llvm-commits mailing list