[mlir][sparse] add new complex ops to reduction recognition
authorAart Bik <ajcbik@google.com>
Tue, 24 May 2022 18:49:47 +0000 (11:49 -0700)
committerAart Bik <ajcbik@google.com>
Tue, 24 May 2022 22:00:56 +0000 (15:00 -0700)
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D126318

mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp

index 1a13eec..6453cf9 100644 (file)
@@ -378,11 +378,14 @@ static vector::CombiningKind getCombiningKind(Reduction kind) {
 static Reduction getReduction(Kind kind) {
   switch (kind) {
   case Kind::kAddF:
+  case Kind::kAddC:
   case Kind::kAddI:
   case Kind::kSubF:
+  case Kind::kSubC:
   case Kind::kSubI:
     return kSum;
   case Kind::kMulF:
+  case Kind::kMulC:
   case Kind::kMulI:
     return kProduct;
   case Kind::kAndI: