Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

LoadType is already of Type *.

LoadType is already of Type *.
@llvmbot
Copy link
Member

llvmbot commented Aug 3, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

LoadType is already of Type *.


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp (+1-1)
diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
index 6bdf76f789a49..a8839981e5478 100644
--- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
@@ -117,7 +117,7 @@ struct StoreToLoadForwardingCandidate {
     if (std::abs(StrideLoad) != 1)
       return false;
 
-    unsigned TypeByteSize = DL.getTypeAllocSize(const_cast<Type *>(LoadType));
+    unsigned TypeByteSize = DL.getTypeAllocSize(LoadType);
 
     auto *LoadPtrSCEV = cast<SCEVAddRecExpr>(PSE.getSCEV(LoadPtr));
     auto *StorePtrSCEV = cast<SCEVAddRecExpr>(PSE.getSCEV(StorePtr));

@kazutakahirata kazutakahirata merged commit c068f8b into llvm:main Aug 3, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250802_cast_llvm_Scalar branch August 3, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants