Merge kDynamicSize and kDynamicSentinel into one constant.

resolve conflicts

Differential Revision: https://reviews.llvm.org/D138282
This commit is contained in:
Aliia Khasanova
2022-11-18 18:00:10 +00:00
parent 861f5dd688
commit 399638f98c
71 changed files with 327 additions and 346 deletions

View File

@@ -237,16 +237,16 @@ convertSparseTensorType(Type type, SmallVectorImpl<Type> &fields) {
// order. Clients of this type know what field is what from the sparse
// tensor type.
if (isCompressedDim(rType, r)) {
fields.push_back(MemRefType::get({ShapedType::kDynamicSize}, ptrType));
fields.push_back(MemRefType::get({ShapedType::kDynamicSize}, idxType));
fields.push_back(MemRefType::get({ShapedType::kDynamic}, ptrType));
fields.push_back(MemRefType::get({ShapedType::kDynamic}, idxType));
} else if (isSingletonDim(rType, r)) {
fields.push_back(MemRefType::get({ShapedType::kDynamicSize}, idxType));
fields.push_back(MemRefType::get({ShapedType::kDynamic}, idxType));
} else {
assert(isDenseDim(rType, r)); // no fields
}
}
// The values array.
fields.push_back(MemRefType::get({ShapedType::kDynamicSize}, eltType));
fields.push_back(MemRefType::get({ShapedType::kDynamic}, eltType));
assert(fields.size() == lastField);
return success();
}
@@ -288,7 +288,7 @@ static void allocSchemeForRank(OpBuilder &builder, Location loc,
/// Creates allocation operation.
static Value createAllocation(OpBuilder &builder, Location loc, Type type,
Value sz, bool enableInit) {
auto memType = MemRefType::get({ShapedType::kDynamicSize}, type);
auto memType = MemRefType::get({ShapedType::kDynamic}, type);
Value buffer = builder.create<memref::AllocOp>(loc, memType, sz);
if (enableInit) {
Value fillValue =
@@ -792,7 +792,7 @@ public:
assert(sz); // This for sure is a sparse tensor
// Generate a memref for `sz` elements of type `t`.
auto genAlloc = [&](Type t) {
auto memTp = MemRefType::get({ShapedType::kDynamicSize}, t);
auto memTp = MemRefType::get({ShapedType::kDynamic}, t);
return rewriter.create<memref::AllocOp>(loc, memTp, ValueRange{*sz});
};
// Allocate temporary buffers for values/filled-switch and added.