[Mlir-commits] [mlir] [MLIR][XeGPU] add xegpu.set_desc_layout transform op (PR #165615)

Rolf Morel llvmlistbot at llvm.org
Tue Nov 4 13:31:46 PST 2025


================
@@ -0,0 +1,67 @@
+#  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
+
+from .._xegpu_transform_ops_gen import *
+from .._xegpu_transform_ops_gen import _Dialect
+
+try:
+    from ...ir import *
+    from .._ods_common import _cext as _ods_cext
+    from .._ods_common import (
+        MixedValues,
+        get_op_result_or_value as _get_op_result_or_value,
+        _dispatch_dynamic_index_list,
+    )
+
+except ImportError as e:
+    raise RuntimeError("Error loading imports from extension module") from e
+
+from typing import Union
+
+
+ at _ods_cext.register_operation(_Dialect, replace=True)
+class SetDescLayoutOp(SetDescLayoutOp):
+    """Specialization for SetDescLayoutOp class."""
+
+    def __init__(
+        self,
+        target: Union[Operation, Value],
+        sg_layout: MixedValues,
+        *,
+        sg_data: MixedValues = None,
+        inst_data: MixedValues = None,
+        loc=None,
+        ip=None,
+    ):
+        target_value = _get_op_result_or_value(target)
----------------
rolfmorel wrote:

Ah, I understand now -- thank you. 

This is about taking the value, i.e. result, of the transform op that came prior to the current transform op. This SSA-value will be a handle to an operation though. (My confusion comes from that it could also be been a [handle to a value](https://mlir.llvm.org/docs/Dialects/Transform/#transformvaluehandletypeinterface-transformvaluehandletypeinterface).)

I might have preferred a different variable name, though also do not mind much.

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


More information about the Mlir-commits mailing list