================
@@ -33,6 +33,28 @@ static mlir::Value emitIntrinsicCallOp(CIRGenFunction &cgf,
const CallExpr *e,
.getResult();
}
+static mlir::Value getMaskVecValue(CIRGenBuilderTy &builder, mlir::Value mask,
+ unsigned numElems) {
+ auto maskIntType = mlir::cast<cir::IntType>(mask.getType());
+ unsigned maskWidth = maskIntType.getWidth();
+
+ // Create a vector of bool type with maskWidth elements
+ auto maskVecType =
+ cir::VectorType::get(builder.getContext(),
+ cir::BoolType::get(builder.getContext()),
maskWidth);
+ mlir::Value maskVec = builder.createBitcast(mask, maskVecType);
+
+ // If we have less than 8 elements, then the starting mask was an i8 and
+ // we need to extract down to the right number of elements.
+ if (numElems < 8) {
+ llvm::SmallVector<int64_t, 4> indices;
+ for (unsigned i = 0; i != numElems; ++i)
+ indices.push_back(i);
----------------
ahmednoursphinx wrote:
Great optimization, updated
https://github.com/llvm/llvm-project/pull/168757
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits