[mlir][sparse] Add an attribute to the sort operator for stable sorting.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135181
This commit is contained in:
bixia1
2022-10-04 10:37:38 -07:00
parent 1d1aa2d013
commit 8c02ca1da5
3 changed files with 35 additions and 4 deletions

View File

@@ -675,6 +675,11 @@ LogicalResult SelectOp::verify() {
return success();
}
void SortOp::build(OpBuilder &odsBuilder, OperationState &odsState, Value n,
ValueRange xs, ValueRange ys) {
build(odsBuilder, odsState, n, xs, ys, /*stable=*/false);
}
LogicalResult SortOp::verify() {
if (getXs().empty())
return emitError("need at least one xs buffer.");