[Mlir-commits] [mlir] [MLIR] support dynamic indexing of `vector.maskedload` in `VectorEmulateNarrowTypes` (PR #115070)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 11 16:45:04 PST 2024
================
@@ -185,6 +188,25 @@ static Value dynamicallyExtractSubVector(OpBuilder &rewriter, Location loc,
return dest;
}
+/// Inserts a 1-D subvector into a 1-D `dest` vector at index `offset`.
+static Value dynamicallyInsertSubVector(RewriterBase &rewriter, Location loc,
+ TypedValue<VectorType> source,
+ Value dest, OpFoldResult destOffsetVar,
+ int64_t length) {
+ assert(length > 0 && "length must be greater than 0");
+ for (int i = 0; i < length; ++i) {
+ Value insertLoc =
+ i == 0
+ ? destOffsetVar.dyn_cast<Value>()
----------------
lialan wrote:
I like this idea to fold it. updated.
https://github.com/llvm/llvm-project/pull/115070
More information about the Mlir-commits
mailing list