[clang] [CIR] Upstream ThreeWayCmpOp (PR #169963)

Hendrik Hübner via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 15 16:05:00 PST 2026


================
@@ -447,6 +447,68 @@ def CIR_ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// CmpThreeWayInfoAttr
+//===----------------------------------------------------------------------===//
+
+def CIR_CmpOrdering : CIR_I32EnumAttr<
+  "CmpOrdering", "three-way comparison ordering kind", [
+    I32EnumAttrCase<"Strong", 0, "strong">,
+    I32EnumAttrCase<"Partial", 1, "partial">
+]> {
+  let genSpecializedAttr = 0;
+}
+
+def CIR_CmpThreeWayInfoAttr : CIR_Attr<"CmpThreeWayInfo", "cmp3way_info"> {
+  let summary = "Holds information about a three-way comparison operation";
+  let description = [{
+    The `#cmp3way_info` attribute contains information about a three-way
+    comparison operation `cir.cmp3way`.
----------------
HendrikHuebner wrote:

Yes, the attribute is only used for `cir.cmp3way`, which is only emitted for the builtin `<=>`. 

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


More information about the cfe-commits mailing list