@@ -70,6 +70,9 @@ struct TensorExp final {
70
70
// / and kSelect, this holds the original operation with all regions. For
71
71
// / kBinaryBranch, this holds the YieldOp for the left or right half
72
72
// / to be merged into a nested scf loop.
73
+ // /
74
+ // / Or the actual operation that we can not sparsify but having all dense
75
+ // / operands for kDenseOp.
73
76
Operation *op;
74
77
75
78
// / An optional attribute that is required to determine the semantics of the
@@ -157,8 +160,9 @@ enum class TensorExp::Kind {
157
160
kShrS , // signed
158
161
kShrU , // unsigned
159
162
kShlI ,
160
- kBinary , // semiring binary op
161
- kReduce , // semiring reduction op
163
+ kBinary , // semiring binary op
164
+ kReduce , // semiring reduction op
165
+ kDenseOp , // special category of operations requiring all dense operands
162
166
};
163
167
164
168
// ===----------------------------------------------------------------------===//
@@ -645,7 +649,11 @@ class Merger {
645
649
Type inferType (ExprId e, Value src) const ;
646
650
647
651
// / Traverses the SSA tree (possibly a DAG) to build a tensor expression.
648
- std::optional<ExprId> buildTensorExp (linalg::GenericOp op, Value v);
652
+ // / The boolean value returned indicates whether the result of the current
653
+ // / operation being built depends on any value that is loaded from a sparse
654
+ // / tensor.
655
+ std::pair<std::optional<ExprId>, bool > buildTensorExp (linalg::GenericOp op,
656
+ Value v);
649
657
650
658
// / Merger data structures.
651
659
const TensorId outTensor;
0 commit comments