================
@@ -417,6 +417,95 @@ static mlir::Value emitX86vpcom(CIRGenBuilderTy &builder,
mlir::Location loc,
return builder.createVecCompare(loc, pred, op0, op1);
}
+// Emits masked result similar to EmitX86MaskedCompareResult in
+// clang/lib/CodeGen/TargetBuiltins/X86.cpp
+static mlir::Value emitX86MaskedResult(CIRGenBuilderTy &builder,
+ mlir::Location loc, mlir::Value cmp,
+ unsigned numElts, mlir::Value maskIn) {
+ if (maskIn) {
+ auto constOp =
+ mlir::dyn_cast_or_null<cir::ConstantOp>(maskIn.getDefiningOp());
+ if (!constOp || !constOp.isAllOnesValue()) {
+ mlir::Value maskVec = getBoolMaskVecValue(builder, loc, maskIn, numElts);
----------------
andykaylor wrote:
```suggestion
mlir::Value maskVec = getMaskVecValue(builder, loc, maskIn, numElts);
```
I didn't notice when `getBoolMaskVecValue` was introduced that it is a
duplicate of `getMaskVecValue`. I'll be removing the former in favor of the
latter.
https://github.com/llvm/llvm-project/pull/172813
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits