[Mlir-commits] [mlir] [mlir][linalg] Add support to pass attributes to the packed ops (PR #79526)

Han-Chung Wang llvmlistbot at llvm.org
Thu Jan 25 20:14:26 PST 2024


================
@@ -369,7 +369,9 @@ struct GenerateLoopNest {
 /// Returns an attribute list that excludes pre-defined attributes.
 template <typename OpTy>
 SmallVector<NamedAttribute> getPrunedAttributeList(OpTy op) {
-  auto elidedAttrs = llvm::to_vector(op.getAttributeNames());
+  // op.getAttributeNames() doesn't work when the op is linalg::LinalgOp.
+  // Instead use the static function to get attribute names.
+  auto elidedAttrs = llvm::to_vector(linalg::GenericOp::getAttributeNames());
----------------
hanhanW wrote:

But this is a function template. Why can you assume that all the operations have attributes as identical as a GenericOp?

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


More information about the Mlir-commits mailing list