mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 00:46:45 +08:00
[mlir][sparse] avoid slice rewriting when conditions are not met
Reviewed By: Peiming Differential Revision: https://reviews.llvm.org/D148964
This commit is contained in:
@@ -1165,11 +1165,9 @@ public:
|
||||
MLIRContext *ctx = op.getContext();
|
||||
auto srcEnc = getSparseTensorEncoding(op.getSourceType());
|
||||
auto dstEnc = getSparseTensorEncoding(op.getResult().getType());
|
||||
if (!srcEnc && !dstEnc)
|
||||
return failure();
|
||||
|
||||
// TODO: We should check these in ExtractSliceOp::verify.
|
||||
assert(srcEnc && dstEnc && dstEnc.isSlice());
|
||||
if (!srcEnc || !dstEnc || !dstEnc.isSlice())
|
||||
return failure();
|
||||
assert(srcEnc.getDimLevelType() == dstEnc.getDimLevelType());
|
||||
assert(srcEnc.getDimOrdering() == dstEnc.getDimOrdering());
|
||||
assert(srcEnc.getHigherOrdering() == dstEnc.getHigherOrdering());
|
||||
|
||||
Reference in New Issue
Block a user