[llvm] [IR] Remove an unnecessary cast (NFC) (PR #147453)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 20:17:30 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

predicate is already of Predicate.


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


1 Files Affected:

- (modified) llvm/lib/IR/Instructions.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 3cfee89a1fdf5..9fe79366f9b2f 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -3488,7 +3488,7 @@ CmpInst::CmpInst(Type *ty, OtherOps op, Predicate predicate, Value *LHS,
     : Instruction(ty, op, AllocMarker, InsertBefore) {
   Op<0>() = LHS;
   Op<1>() = RHS;
-  setPredicate((Predicate)predicate);
+  setPredicate(predicate);
   setName(Name);
   if (FlagsSource)
     copyIRFlags(FlagsSource);

``````````

</details>


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


More information about the llvm-commits mailing list