[PATCH] D75722: [mlir][Linalg] Implement padding for linalg.conv and lowering to loops.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 10:18:28 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td:323
+      if (!padding().hasValue()) return 0;
+      return padding().getValue().getValue<IntegerAttr>({i, 0}).getInt();
+    }
----------------
nit: When using a DenseElementsAttr please do not use attributes as the value type whenever possible, it is very expensive(we have to create a new attribute, which requires acquiring a lock). If the value is an integer, use APInt. If the width of the integer is statically known, like in this case, use the corresponding C++ type. In this case you can use `getValue<int64_t>`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75722/new/

https://reviews.llvm.org/D75722





More information about the llvm-commits mailing list