[clang] [CIR] Upstream convert to mask builtins in CIR codegen (PR #171694)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 15 09:38:23 PST 2025


================
@@ -278,6 +284,127 @@ static mlir::Value emitX86MaskTest(CIRGenBuilderTy &builder, mlir::Location loc,
   return emitIntrinsicCallOp(builder, loc, intrinsicName, resTy,
                              mlir::ValueRange{lhsVec, rhsVec});
 }
+// TODO: The cgf parameter should be removed when all the NYI cases are
+// implemented.
+static std::optional<mlir::Value> emitX86MaskedCompareResult(CIRGenFunction &cgf, CIRGenBuilderTy &builder,
+                                              mlir::Value cmp, unsigned numElts,
+                                              mlir::Value maskIn,
+                                              mlir::Location loc) {
+  if (maskIn) {
+    cgf.cgm.errorNYI(loc, "emitX86MaskedCompareResult");
----------------
andykaylor wrote:

```suggestion
    cgf.cgm.errorNYI(loc, "emitX86MaskedCompareResult");
    return {};
```
Returning a null `mlir::Value` rather than `std::nullopt` indicates that we already reported an error.

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


More information about the cfe-commits mailing list