[llvm] IR: fix getSwappedCmpPredicate() return type (PR #120097)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 07:31:12 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>

The change 51a895a (IR: introduce struct with CmpInst::Predicate and samesign) missed a change to ICmpInst::getSwappedCmpPredicate(), which intends to return a CmpPredicate, but returns a Predicate instead. Fix this.

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


1 Files Affected:

- (modified) llvm/include/llvm/IR/Instructions.h (+3-3) 


``````````diff
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index a42bf6bca1b9fb..a8df12a1282fcc 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -1226,9 +1226,9 @@ class ICmpInst: public CmpInst {
     return {getSwappedPredicate(Pred), Pred.hasSameSign()};
   }
 
-  /// @returns the swapped predicate.
-  Predicate getSwappedCmpPredicate() const {
-    return getSwappedPredicate(getCmpPredicate());
+  /// @returns the swapped predicate along with samesign information.
+  CmpPredicate getSwappedCmpPredicate() const {
+    return getSwappedCmpPredicate(getCmpPredicate());
   }
 
   /// For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.

``````````

</details>


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


More information about the llvm-commits mailing list