================
@@ -264,15 +264,31 @@ static mlir::Value emitX86MaskTest(CIRGenBuilderTy
&builder, mlir::Location loc,
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) {
+emitX86MaskedCompareResult(CIRGenBuilderTy &builder, mlir::Value cmp,
+ unsigned numElts, mlir::Value maskIn,
+ mlir::Location loc) {
if (maskIn) {
- cgf.cgm.errorNYI(loc, "emitX86MaskedCompareResult");
- return {};
+ bool isAllOnes = false;
+ mlir::Value maskInValue = maskIn;
+ auto castOp = mlir::dyn_cast_or_null<cir::CastOp>(maskIn.getDefiningOp());
+ if (castOp && castOp.getKind() == cir::CastKind::integral) {
+ maskInValue = castOp.getResult();
+ isAllOnes = true;
----------------
andykaylor wrote:
This is not right. You can't assume just based on this being an integral cast
that the value is all ones. What is the specific cast that this is meant to
handle?
https://github.com/llvm/llvm-project/pull/172813
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits