================
@@ -152,6 +153,41 @@ computeFullLaneShuffleMask(CIRGenFunction &cgf, const
mlir::Value vec,
outIndices.resize(numElts);
}
+static mlir::Value getBoolMaskVecValue(CIRGenBuilderTy &builder,
+ mlir::Location loc, mlir::Value mask,
+ unsigned numElems) {
+
+ cir::BoolType boolTy = builder.getBoolTy();
+ auto maskTy = cir::VectorType::get(
+ boolTy, cast<cir::IntType>(mask.getType()).getWidth());
+ mlir::Value maskVec = builder.createBitcast(mask, maskTy);
+
+ if (numElems < 8) {
+ SmallVector<mlir::Attribute> indices;
+ indices.reserve(numElems);
+ mlir::Type i32Ty = builder.getSInt32Ty();
+ for (auto i : llvm::seq<unsigned>(0, numElems))
+ indices.push_back(cir::IntAttr::get(i32Ty, i));
+
+ maskVec = builder.createVecShuffle(loc, maskVec, maskVec, indices);
+ }
+ return maskVec;
+}
+
+static mlir::Value emitX86Select(CIRGenBuilderTy &builder, mlir::Location loc,
+ mlir::Value mask, mlir::Value op0,
+ mlir::Value op1) {
+ auto constOp = mlir::dyn_cast_or_null<cir::ConstantOp>(mask.getDefiningOp());
----------------
YGGkk wrote:
Hi, I have a question for this cast code. The mask in this function is a
castOp, so when the mask cat to ConstOp, the constOp is always the nullptr
https://github.com/llvm/llvm-project/pull/170427
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits