<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/IR/BuiltinTypes.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[mlir][spirv] Add support for SPV_ARM_graph extension - part 1 (#151934)</title>
<updated>2025-09-02T19:18:10+00:00</updated>
<author>
<name>Davide Grohmann</name>
<email>davide.grohmann@arm.com</email>
</author>
<published>2025-09-02T19:18:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf3a8876f4129f76884a67f6db9214adb7adedc6'/>
<id>cf3a8876f4129f76884a67f6db9214adb7adedc6</id>
<content type='text'>
This is the first patch to add support for the SPV_ARM_graph SPIR-V
extension to MLIR’s SPIR-V dialect. The extension introduces a new Graph
abstraction for expressing dataflow computations over full resources.

The part 1 implementation includes:

- A new `GraphType`, modeled similarly to `FunctionType`, for typed
graph signatures.
- New operations in the `spirv.arm` namespace:
  - `spirv.arm.Graph`
  - `spirv.arm.GraphEntryPoint`
  - `spirv.arm.GraphConstant`
  - `spirv.arm.GraphOutput`
-  Verifier and VCE updates to properly gate usage under SPV_ARM_graph.
-  Tests covering parsing and verification.

Graphs currently support only SPV_ARM_tensors, but are designed to
generalize to other resource types, such as images.

Spec: KhronosGroup/SPIRV-Registry#346
RFC:
https://discourse.llvm.org/t/rfc-add-support-for-spv-arm-graph-extension-in-mlir-spir-v-dialect/86947

---------

Signed-off-by: Davide Grohmann &lt;davide.grohmann@arm.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first patch to add support for the SPV_ARM_graph SPIR-V
extension to MLIR’s SPIR-V dialect. The extension introduces a new Graph
abstraction for expressing dataflow computations over full resources.

The part 1 implementation includes:

- A new `GraphType`, modeled similarly to `FunctionType`, for typed
graph signatures.
- New operations in the `spirv.arm` namespace:
  - `spirv.arm.Graph`
  - `spirv.arm.GraphEntryPoint`
  - `spirv.arm.GraphConstant`
  - `spirv.arm.GraphOutput`
-  Verifier and VCE updates to properly gate usage under SPV_ARM_graph.
-  Tests covering parsing and verification.

Graphs currently support only SPV_ARM_tensors, but are designed to
generalize to other resource types, such as images.

Spec: KhronosGroup/SPIRV-Registry#346
RFC:
https://discourse.llvm.org/t/rfc-add-support-for-spv-arm-graph-extension-in-mlir-spir-v-dialect/86947

---------

Signed-off-by: Davide Grohmann &lt;davide.grohmann@arm.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Add `isStatic`* size check for `ShapedType`s. NFCI. (#147085)</title>
<updated>2025-07-07T18:57:27+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-07-07T18:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6512ca7ddb0a462362aaedb18844e2993c5ae336'/>
<id>6512ca7ddb0a462362aaedb18844e2993c5ae336</id>
<content type='text'>
The motivation is to avoid having to negate `isDynamic*` checks, avoid
double negations, and allow for `ShapedType::isStaticDim` to be used in
ADT functions without having to wrap it in a lambda performing the
negation.

Also add the new functions to C and Python bindings.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The motivation is to avoid having to negate `isDynamic*` checks, avoid
double negations, and allow for `ShapedType::isStaticDim` to be used in
ADT functions without having to wrap it in a lambda performing the
negation.

Also add the new functions to C and Python bindings.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Remove unused includes (NFC) (#146812)</title>
<updated>2025-07-03T16:08:09+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-03T16:08:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e8f491fc973e27c657b5de4e8d0b80ac566403ab'/>
<id>e8f491fc973e27c657b5de4e8d0b80ac566403ab</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Determine contiguousness of memrefs with dynamic dimensions (#142421)</title>
<updated>2025-06-23T08:28:33+00:00</updated>
<author>
<name>Momchil Velikov</name>
<email>momchil.velikov@arm.com</email>
</author>
<published>2025-06-23T08:28:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4af96a9d83335b3b59f3441af47c879c7a9eb183'/>
<id>4af96a9d83335b3b59f3441af47c879c7a9eb183</id>
<content type='text'>
This patch enhances `MemRefType::areTrailingDimsContiguous` to also
handle memrefs with dynamic dimensions.

The implementation itself is based on a new member function
`MemRefType::getMaxCollapsableTrailingDims` that return the maximum
number of trailing dimensions that can be collapsed - trivially all
dimensions for memrefs with identity layout, or by examining the memref
strides stopping at discontiguous or statically unknown strides.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch enhances `MemRefType::areTrailingDimsContiguous` to also
handle memrefs with dynamic dimensions.

The implementation itself is based on a new member function
`MemRefType::getMaxCollapsableTrailingDims` that return the maximum
number of trailing dimensions that can be collapsed - trivially all
dimensions for memrefs with identity layout, or by examining the memref
strides stopping at discontiguous or statically unknown strides.</pre>
</div>
</content>
</entry>
<entry>
<title>Make getStridesAndOffset const (#145148)</title>
<updated>2025-06-22T09:21:47+00:00</updated>
<author>
<name>Evan Liu</name>
<email>liuyievan@gmail.com</email>
</author>
<published>2025-06-22T09:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6ae5b89553a9393cc9ab68c0d776a506381a3009'/>
<id>6ae5b89553a9393cc9ab68c0d776a506381a3009</id>
<content type='text'>
Make getStridesAndOffset const.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make getStridesAndOffset const.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][core|ptr] Add `PtrLikeTypeInterface` and casting ops to the `ptr` dialect (#137469)</title>
<updated>2025-06-20T18:23:39+00:00</updated>
<author>
<name>Fabian Mora</name>
<email>fmora.dev@gmail.com</email>
</author>
<published>2025-06-20T18:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f159774352c37a75829c04febb89f141175fc2bf'/>
<id>f159774352c37a75829c04febb89f141175fc2bf</id>
<content type='text'>
This patch adds the `PtrLikeTypeInterface` type interface to identify
pointer-like types. This interface is defined as:

```
A ptr-like type represents an object storing a memory address. This object
is constituted by:
- A memory address called the base pointer. This pointer is treated as a
  bag of bits without any assumed structure. The bit-width of the base
  pointer must be a compile-time constant. However, the bit-width may remain
  opaque or unavailable during transformations that do not depend on the
  base pointer. Finally, it is considered indivisible in the sense that as
  a `PtrLikeTypeInterface` value, it has no metadata.
- Optional metadata about the pointer. For example, the size of the  memory
  region associated with the pointer.

Furthermore, all ptr-like types have two properties:
- The memory space associated with the address held by the pointer.
- An optional element type. If the element type is not specified, the
  pointer is considered opaque.
```

This patch adds this interface to `!ptr.ptr` and the `memref` type.

Furthermore, this patch adds necessary ops and type to handle casting
between `!ptr.ptr` and ptr-like types.

First, it defines the `!ptr.ptr_metadata` type. An opaque type to
represent the metadata of a ptr-like type. The rationale behind adding
this type, is that at high-level the metadata of a type like `memref`
cannot be specified, as its structure is tied to its lowering.

The `ptr.get_metadata` operation was added to extract the opaque pointer
metadata. The concrete structure of the metadata is only known when the
op is lowered.

Finally, this patch adds the `ptr.from_ptr` and `ptr.to_ptr` operations.
Allowing to cast back and forth between `!ptr.ptr` and ptr-like types.

```mlir
func.func @func(%mr: memref&lt;f32, #ptr.generic_space&gt;) -&gt; memref&lt;f32, #ptr.generic_space&gt; {
  %ptr = ptr.to_ptr %mr : memref&lt;f32, #ptr.generic_space&gt; -&gt; !ptr.ptr&lt;#ptr.generic_space&gt;
  %mda = ptr.get_metadata %mr : memref&lt;f32, #ptr.generic_space&gt;
  %res = ptr.from_ptr %ptr metadata %mda : !ptr.ptr&lt;#ptr.generic_space&gt; -&gt; memref&lt;f32, #ptr.generic_space&gt;
  return %res : memref&lt;f32, #ptr.generic_space&gt;
}
```

It's future work to replace and remove the `bare-ptr-convention` through
the use of these ops.

---------

Co-authored-by: Mehdi Amini &lt;joker.eph@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the `PtrLikeTypeInterface` type interface to identify
pointer-like types. This interface is defined as:

```
A ptr-like type represents an object storing a memory address. This object
is constituted by:
- A memory address called the base pointer. This pointer is treated as a
  bag of bits without any assumed structure. The bit-width of the base
  pointer must be a compile-time constant. However, the bit-width may remain
  opaque or unavailable during transformations that do not depend on the
  base pointer. Finally, it is considered indivisible in the sense that as
  a `PtrLikeTypeInterface` value, it has no metadata.
- Optional metadata about the pointer. For example, the size of the  memory
  region associated with the pointer.

Furthermore, all ptr-like types have two properties:
- The memory space associated with the address held by the pointer.
- An optional element type. If the element type is not specified, the
  pointer is considered opaque.
```

This patch adds this interface to `!ptr.ptr` and the `memref` type.

Furthermore, this patch adds necessary ops and type to handle casting
between `!ptr.ptr` and ptr-like types.

First, it defines the `!ptr.ptr_metadata` type. An opaque type to
represent the metadata of a ptr-like type. The rationale behind adding
this type, is that at high-level the metadata of a type like `memref`
cannot be specified, as its structure is tied to its lowering.

The `ptr.get_metadata` operation was added to extract the opaque pointer
metadata. The concrete structure of the metadata is only known when the
op is lowered.

Finally, this patch adds the `ptr.from_ptr` and `ptr.to_ptr` operations.
Allowing to cast back and forth between `!ptr.ptr` and ptr-like types.

```mlir
func.func @func(%mr: memref&lt;f32, #ptr.generic_space&gt;) -&gt; memref&lt;f32, #ptr.generic_space&gt; {
  %ptr = ptr.to_ptr %mr : memref&lt;f32, #ptr.generic_space&gt; -&gt; !ptr.ptr&lt;#ptr.generic_space&gt;
  %mda = ptr.get_metadata %mr : memref&lt;f32, #ptr.generic_space&gt;
  %res = ptr.from_ptr %ptr metadata %mda : !ptr.ptr&lt;#ptr.generic_space&gt; -&gt; memref&lt;f32, #ptr.generic_space&gt;
  return %res : memref&lt;f32, #ptr.generic_space&gt;
}
```

It's future work to replace and remove the `bare-ptr-convention` through
the use of these ops.

---------

Co-authored-by: Mehdi Amini &lt;joker.eph@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir][MemRef] Remove integer address space builders" (#138853)</title>
<updated>2025-05-07T11:43:55+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2025-05-07T11:43:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c02aa91939d174a1efda934706d7b523b2fb7e31'/>
<id>c02aa91939d174a1efda934706d7b523b2fb7e31</id>
<content type='text'>
Reverts llvm/llvm-project#138579

An integration test is broken on the mlir-nvidia* bots.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#138579

An integration test is broken on the mlir-nvidia* bots.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][MemRef] Remove integer address space builders (#138579)</title>
<updated>2025-05-06T16:22:15+00:00</updated>
<author>
<name>Krzysztof Drewniak</name>
<email>Krzysztof.Drewniak@amd.com</email>
</author>
<published>2025-05-06T16:22:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c7c1283ab2fbef0843c1ec2ea80477834cccb0eb'/>
<id>c7c1283ab2fbef0843c1ec2ea80477834cccb0eb</id>
<content type='text'>
The forms of the MemRef builder that took an integer argument instead of
an attribute have been deprecated for years now, and have almost no
upstream uses (the remaining ones are handled in this PR). Therefore,
remove them.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The forms of the MemRef builder that took an integer argument instead of
an attribute have been deprecated for years now, and have almost no
upstream uses (the remaining ones are handled in this PR). Therefore,
remove them.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][MemRef][~NFC] Move getStridesAndOffset() onto layouts (#138011)</title>
<updated>2025-05-05T16:09:32+00:00</updated>
<author>
<name>Krzysztof Drewniak</name>
<email>Krzysztof.Drewniak@amd.com</email>
</author>
<published>2025-05-05T16:09:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=640103b91ac892cfbeeb614495698c321437b567'/>
<id>640103b91ac892cfbeeb614495698c321437b567</id>
<content type='text'>
This commit refactors the getStridesAndOffet() method on MemRefType to
just call `MemRefLayoutAttrInterface::getStridesAndOffset(shape,
strides&amp; offset&amp;)`, allowing downstream users and future layouts (ex, a
potential contiguous layout) to implement it without needing to patch
BuiltinTypes or without needing them to conform their affine maps to the
canonical strided form.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit refactors the getStridesAndOffet() method on MemRefType to
just call `MemRefLayoutAttrInterface::getStridesAndOffset(shape,
strides&amp; offset&amp;)`, allowing downstream users and future layouts (ex, a
potential contiguous layout) to implement it without needing to patch
BuiltinTypes or without needing them to conform their affine maps to the
canonical strided form.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IR][NFC] Move free-standing functions to `MemRefType` (#123465)</title>
<updated>2025-01-21T07:48:09+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2025-01-21T07:48:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6aaa8f25b66dc1fef4e465f274ee40b82d632988'/>
<id>6aaa8f25b66dc1fef4e465f274ee40b82d632988</id>
<content type='text'>
Turn free-standing `MemRefType`-related helper functions in
`BuiltinTypes.h` into member functions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Turn free-standing `MemRefType`-related helper functions in
`BuiltinTypes.h` into member functions.</pre>
</div>
</content>
</entry>
</feed>
