File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
mlir/lib/Dialect/SparseTensor/IR Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1142,16 +1142,18 @@ bool mlir::sparse_tensor::isBlockSparsity(AffineMap dimToLvl) {
11421142 auto pos = dimOp.getPosition ();
11431143 if (binOp.getKind () == AffineExprKind::FloorDiv) {
11441144 // Expect only one floordiv for each dimension.
1145- if (coeffientMap.find (pos) != coeffientMap.end ())
1145+ auto [it, inserted] = coeffientMap.try_emplace (pos);
1146+ if (!inserted)
11461147 return false ;
11471148 // Record coefficient of the floordiv.
1148- coeffientMap[pos] = conOp.getValue ();
1149+ it-> second = conOp.getValue ();
11491150 } else if (binOp.getKind () == AffineExprKind::Mod) {
11501151 // Expect floordiv before mod.
1151- if (coeffientMap.find (pos) == coeffientMap.end ())
1152+ auto it = coeffientMap.find (pos);
1153+ if (it == coeffientMap.end ())
11521154 return false ;
11531155 // Expect mod to have the same coefficient as floordiv.
1154- if (conOp.getValue () != coeffientMap[pos] )
1156+ if (conOp.getValue () != it-> second )
11551157 return false ;
11561158 hasBlock = true ;
11571159 } else {
You can’t perform that action at this time.
0 commit comments