Skip to content

[IR] Remove an unnecessary cast (NFC) #146250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

Agg is already of Type *.

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

llvmbot commented Jun 29, 2025

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

Changes

Agg is already of Type *.


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

1 Files Affected:

  • (modified) llvm/lib/IR/Instructions.cpp (+1-1)
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 8d9b545d4134f..3cfee89a1fdf5 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -2582,7 +2582,7 @@ Type *ExtractValueInst::getIndexedType(Type *Agg,
       return nullptr;
     }
   }
-  return const_cast<Type*>(Agg);
+  return Agg;
 }
 
 //===----------------------------------------------------------------------===//

@kazutakahirata kazutakahirata merged commit 8a4b6cd into llvm:main Jun 29, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250628_cast_llvm_IR branch June 29, 2025 03:41
@kazutakahirata kazutakahirata restored the cleanup_20250628_cast_llvm_IR branch June 29, 2025 03:41
@kazutakahirata kazutakahirata deleted the cleanup_20250628_cast_llvm_IR branch June 29, 2025 03:41
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants