[Mlir-commits] [mlir] [mlir][sparse] avoid non-perm on sparse tensor convert for new (PR #72459)

Peiming Liu llvmlistbot at llvm.org
Wed Nov 15 20:28:15 PST 2023


================
@@ -1189,27 +1189,38 @@ struct NewRewriter : public OpRewritePattern<NewOp> {
   LogicalResult matchAndRewrite(NewOp op,
                                 PatternRewriter &rewriter) const override {
     Location loc = op.getLoc();
-    const auto dstTp = getSparseTensorType(op.getResult());
-    const auto encDst = dstTp.getEncoding();
-    if (!dstTp.hasEncoding() || getCOOStart(encDst) == 0)
+    auto stt = getSparseTensorType(op.getResult());
+    auto enc = stt.getEncoding();
+    if (!stt.hasEncoding() || getCOOStart(enc) == 0)
----------------
PeimingLiu wrote:

Nit: why not just !enc here?

https://github.com/llvm/llvm-project/pull/72459


More information about the Mlir-commits mailing list