[llvm] [SelectionDAG] Add support for the 3-way comparison intrinsics [US]CMP (PR #91871)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 03:37:46 PDT 2024


================
@@ -677,6 +677,12 @@ enum NodeType {
   UMIN,
   UMAX,
 
+  /// [US]CMP - 3-way comparison of signed or unsigned integers. Returns -1, 0,
+  /// or 1 depending on whether Op0 <, ==, or > Op1. The operands can have type
+  /// different to the result.
----------------
RKSimon wrote:

Should we enforce that for vector types the result type should match the operand type? Treating these as close to regular (non-commutable) binops as possible makes sense to me.

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


More information about the llvm-commits mailing list