[Mlir-commits] [mlir] [mlir][python] enable memref.subview (PR #79393)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Jan 29 06:03:11 PST 2024


================
@@ -1,5 +1,126 @@
 #  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 #  See https://llvm.org/LICENSE.txt for license information.
 #  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+import operator
+from itertools import accumulate
+from typing import Optional
 
 from ._memref_ops_gen import *
+from .arith import ConstantOp
+from .transform.structured import _dispatch_mixed_values, MixedValues
+from ..ir import Value, MemRefType, StridedLayoutAttr, ShapedType
+
+
+def _is_constant(i):
+    return isinstance(i, Value) and isinstance(i.owner.opview, ConstantOp)
----------------
ftynse wrote:

Maybe not for this commit, but should rather expose the `m_ConstantInt` functionality to C API somehow and drop the dependency on the arith dialect here. There are other constant-like operations that we may want to support, and ConstantOp may be defining a floating-point value or a vector that we don't want to support here.

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


More information about the Mlir-commits mailing list