================
@@ -487,6 +487,39 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
return createAddrSpaceCast(src.getLoc(), src, newTy);
}
+
//===--------------------------------------------------------------------===//
+ // Other Instructions
+
//===--------------------------------------------------------------------===//
+
+ mlir::Value createExtractElement(mlir::Location loc, mlir::Value vec,
+ mlir::Value idx) {
+ auto vecTy = mlir::cast<cir::VectorType>(vec.getType());
+ mlir::Type eltTy = vecTy.getElementType();
+ auto op = cir::VecExtractOp::create(*this, loc, eltTy, vec, idx);
+ return op.getResult();
+ }
+
+ mlir::Value createExtractElement(mlir::Location loc, mlir::Value vec,
+ uint64_t idx) {
+ auto idxVal = getConstAPInt(loc, mlir::IntegerType::get(getContext(), 64),
+ llvm::APInt(64, idx));
+ return createExtractElement(loc, vec, idxVal);
+ }
----------------
badumbatish wrote:
this is not used anywhere in the codebase
https://github.com/llvm/llvm-project/pull/174003
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits