<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Dialect/MemRef/IR/ValueBoundsOpInterfaceImpl.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>[MemRef] Fix-forward use-after-scope in #164955 (#165478)</title>
<updated>2025-10-28T22:21:43+00:00</updated>
<author>
<name>Thurston Dang</name>
<email>thurston@google.com</email>
</author>
<published>2025-10-28T22:21:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9804584f75c1ab267431c43a0928a8b0a3814f0'/>
<id>e9804584f75c1ab267431c43a0928a8b0a3814f0</id>
<content type='text'>
https://github.com/llvm/llvm-project/pull/164955 has a use-after-scope
(https://lab.llvm.org/buildbot/#/builders/169/builds/16454):

```
==mlir-opt==3940651==ERROR: AddressSanitizer: stack-use-after-scope on address 0x6e1f6ba5c878 at pc 0x6336b214912a bp 0x7ffe607f1670 sp 0x7ffe607f1668
READ of size 4 at 0x6e1f6ba5c878 thread T0
    #0 0x6336b2149129 in size /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:80:32
    #1 0x6336b2149129 in operator[] /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:299:5
    #2 0x6336b2149129 in populateBoundsForShapedValueDim /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Dialect/MemRef/IR/ValueBoundsOpInterfaceImpl.cpp:113:43
...
```

This patch attempts to fix-forward by stack-allocating reassocIndices,
instead of taking a reference to a return value.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/pull/164955 has a use-after-scope
(https://lab.llvm.org/buildbot/#/builders/169/builds/16454):

```
==mlir-opt==3940651==ERROR: AddressSanitizer: stack-use-after-scope on address 0x6e1f6ba5c878 at pc 0x6336b214912a bp 0x7ffe607f1670 sp 0x7ffe607f1668
READ of size 4 at 0x6e1f6ba5c878 thread T0
    #0 0x6336b2149129 in size /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:80:32
    #1 0x6336b2149129 in operator[] /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/SmallVector.h:299:5
    #2 0x6336b2149129 in populateBoundsForShapedValueDim /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Dialect/MemRef/IR/ValueBoundsOpInterfaceImpl.cpp:113:43
...
```

This patch attempts to fix-forward by stack-allocating reassocIndices,
instead of taking a reference to a return value.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemRef] Implement value bounds interface for CollapseShapeOp (#164955)</title>
<updated>2025-10-28T16:24:35+00:00</updated>
<author>
<name>Jorn Tuyls</name>
<email>jorn.tuyls@gmail.com</email>
</author>
<published>2025-10-28T16:24:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6ad95651159bd5d2671788de19f1ef7748bcb3c9'/>
<id>6ad95651159bd5d2671788de19f1ef7748bcb3c9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MemRef] Fix value bounds interface for ExpandShapeOp (#165333)</title>
<updated>2025-10-27T23:42:29+00:00</updated>
<author>
<name>Jorn Tuyls</name>
<email>jorn.tuyls@gmail.com</email>
</author>
<published>2025-10-27T23:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=66acd04a78c0a9c66fd761c3f09883b6e875b600'/>
<id>66acd04a78c0a9c66fd761c3f09883b6e875b600</id>
<content type='text'>
We shouldn't just consider the dynamic dimensions, but all output
dimensions for the value bounds constraints. The previous test just
worked because the dynamic dimension was on the first position.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We shouldn't just consider the dynamic dimensions, but all output
dimensions for the value bounds constraints. The previous test just
worked because the dynamic dimension was on the first position.</pre>
</div>
</content>
</entry>
<entry>
<title>[MemRef] Implement value bounds interface for ExpandShapeOp (#164438)</title>
<updated>2025-10-23T13:58:25+00:00</updated>
<author>
<name>Jorn Tuyls</name>
<email>jorn.tuyls@gmail.com</email>
</author>
<published>2025-10-23T13:58:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2d18c498b004fe3553d444c54dfe5e2993faa7a9'/>
<id>2d18c498b004fe3553d444c54dfe5e2993faa7a9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][ValueBounds] memref.dim and tensor.dim are always positive (#122804)</title>
<updated>2025-01-13T23:48:03+00:00</updated>
<author>
<name>Krzysztof Drewniak</name>
<email>Krzysztof.Drewniak@amd.com</email>
</author>
<published>2025-01-13T23:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=051612c0180e4e5a9ba750a994a91d2c1b05b00c'/>
<id>051612c0180e4e5a9ba750a994a91d2c1b05b00c</id>
<content type='text'>
Add the constraint that the length of a memref or tensor dimension is
always non-negative (at least 0) even if we don't know which dimension
we're querying the length of.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the constraint that the length of a memref or tensor dimension is
always non-negative (at least 0) even if we don't know which dimension
we're querying the length of.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Update method cast calls to function calls</title>
<updated>2023-05-12T09:21:30+00:00</updated>
<author>
<name>Tres Popp</name>
<email>tpopp@google.com</email>
</author>
<published>2023-05-11T09:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1fa60b4cde512964544ab66404dea79dbc5dcb4'/>
<id>c1fa60b4cde512964544ab66404dea79dbc5dcb4</id>
<content type='text'>
The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Context:

* https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…"
* Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This follows a previous patch that updated calls
`op.cast&lt;T&gt;()-&gt; cast&lt;T&gt;(op)`. However some cases could not handle an
unprefixed `cast` call due to occurrences of variables named cast, or
occurring inside of class definitions which would resolve to the method.
All C++ files that did not work automatically with `cast&lt;T&gt;()` are
updated here to `llvm::cast` and similar with the intention that they
can be easily updated after the methods are removed through a
find-replace.

See https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check
for the clang-tidy check that is used and then update printed
occurrences of the function to include `llvm::` before.

One can then run the following:
```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
                 -export-fixes /tmp/cast/casts.yaml mlir/*\
                 -header-filter=mlir/ -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc
```

Differential Revision: https://reviews.llvm.org/D150348
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Context:

* https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…"
* Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This follows a previous patch that updated calls
`op.cast&lt;T&gt;()-&gt; cast&lt;T&gt;(op)`. However some cases could not handle an
unprefixed `cast` call due to occurrences of variables named cast, or
occurring inside of class definitions which would resolve to the method.
All C++ files that did not work automatically with `cast&lt;T&gt;()` are
updated here to `llvm::cast` and similar with the intention that they
can be easily updated after the methods are removed through a
find-replace.

See https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check
for the clang-tidy check that is used and then update printed
occurrences of the function to include `llvm::` before.

One can then run the following:
```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
                 -export-fixes /tmp/cast/casts.yaml mlir/*\
                 -header-filter=mlir/ -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc
```

Differential Revision: https://reviews.llvm.org/D150348
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][memref] Add ValueBoundsOpInterface impls</title>
<updated>2023-04-06T01:35:52+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>springerm@google.com</email>
</author>
<published>2023-04-06T01:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6510fa90a0c12c18f39601c6f4f70bc7e916fe29'/>
<id>6510fa90a0c12c18f39601c6f4f70bc7e916fe29</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D145695
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D145695
</pre>
</div>
</content>
</entry>
</feed>
