[llvm] IR: introduce struct with CmpInst::Predicate and samesign (PR #116867)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 28 13:45:13 PST 2024


================
@@ -728,6 +728,24 @@ class CmpInst : public Instruction {
           InsertPosition InsertBefore = nullptr,
           Instruction *FlagsSource = nullptr);
 
+  /// Return the signed version of the predicate: variant that operates on
+  /// Predicate; used by the corresponding function in ICmpInst, to operate with
+  /// CmpPredicate.
+  static Predicate getSignedPredicate(Predicate Pred);
+
+  /// Return the unsigned version of the predicate: variant that operates on
+  /// Predicate; used by the corresponding function in ICmpInst, to operate with
+  /// CmpPredicate.
+  static Predicate getUnsignedPredicate(Predicate Pred);
+
+  /// Return the unsigned version of the signed predicate pred or the signed
+  /// version of the signed predicate pred: variant that operates on Predicate;
+  /// used by the corresponding function in ICmpInst, to operate with
+  /// CmpPredicate.
+  static Predicate getFlippedSignednessPredicate(Predicate Pred);
----------------
nikic wrote:

Why are these on CmpInst rather than ICmpInst now?

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


More information about the llvm-commits mailing list