[llvm] 290f38c - IR: fix getSwappedCmpPredicate() return type (#120097)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 16 08:29:28 PST 2024
Author: Ramkumar Ramachandra
Date: 2024-12-16T16:29:21Z
New Revision: 290f38cd1a9fa7b1a91ddb25632807ecb5308dc7
URL: https://github.com/llvm/llvm-project/commit/290f38cd1a9fa7b1a91ddb25632807ecb5308dc7
DIFF: https://github.com/llvm/llvm-project/commit/290f38cd1a9fa7b1a91ddb25632807ecb5308dc7.diff
LOG: IR: fix getSwappedCmpPredicate() return type (#120097)
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.
Added:
Modified:
llvm/include/llvm/IR/Instructions.h
Removed:
################################################################################
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.
More information about the llvm-commits
mailing list