[clang] [CIR] Upstream comparison ops for VectorType (PR #140597)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue May 20 15:59:48 PDT 2025
================
@@ -2083,4 +2083,33 @@ def VecExtractOp : CIR_Op<"vec.extract", [Pure,
let hasFolder = 1;
}
+//===----------------------------------------------------------------------===//
+// VecCmpOp
+//===----------------------------------------------------------------------===//
+
+def VecCmpOp : CIR_Op<"vec.cmp", [Pure, SameTypeOperands]> {
----------------
andykaylor wrote:
I guess that makes sense based on the C/C++ language handling, but I see that the classic codegen generates a vector of i1 and then sign-extends it to the size of the elements that were compared. and we lower to that same pattern when we go to the LLVM dialect.
This is fine for now, but I think we should consider using `cir.cmp + cir.cast(bool_to_int)` later.
https://github.com/llvm/llvm-project/pull/140597
More information about the cfe-commits
mailing list