[mlir][sparse] unify support of (dis)assemble between direct IR/lib path (#71880)
Note that the (dis)assemble operations still make some simplfying assumptions (e.g. trailing 2-D COO in AoS format) but now at least both the direct IR and support library path behave exactly the same. Generalizing the ops is still TBD.
This commit is contained in:
@@ -435,19 +435,6 @@ static ReassociationIndices getReassociationForFlattening(ShapedType srcTp) {
|
||||
return reassociation;
|
||||
}
|
||||
|
||||
/// Generates scalar to tensor cast.
|
||||
static Value genScalarToTensor(OpBuilder &builder, Location loc, Value elem,
|
||||
Type dstTp) {
|
||||
if (auto rtp = dstTp.dyn_cast<RankedTensorType>()) {
|
||||
// Scalars can only be converted to 0-ranked tensors.
|
||||
if (rtp.getRank() != 0)
|
||||
return nullptr;
|
||||
elem = genCast(builder, loc, elem, rtp.getElementType());
|
||||
return builder.create<tensor::FromElementsOp>(loc, rtp, elem);
|
||||
}
|
||||
return genCast(builder, loc, elem, dstTp);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Codegen rules.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user