<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/IR/Verifier.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] Remove unused local variables (NFC) (#138642)</title>
<updated>2025-05-06T14:55:50+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-06T14:55:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=921d16246052dd6a2a8d7d4d7f5833ff8a72d407'/>
<id>921d16246052dd6a2a8d7d4d7f5833ff8a72d407</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Ensure deterministic parallel verification (#134963)</title>
<updated>2025-04-09T22:43:26+00:00</updated>
<author>
<name>Nachi G</name>
<email>nacgarg@users.noreply.github.com</email>
</author>
<published>2025-04-09T22:43:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2f7e685e3d8813ca584cc2f278ac3cd57b43772d'/>
<id>2f7e685e3d8813ca584cc2f278ac3cd57b43772d</id>
<content type='text'>
`failableParallelForEach` will non-deterministically early terminate
upon failure, leading to inconsistent and potentially missing
diagnostics.

This PR uses `parallelForEach` to ensure all operations are verified and
all diagnostics are handled, while tracking the failure state
separately.

Other potential fixes include:
- Making `failableParallelForEach` have deterministic early-exit
behavior (or have an option for it)
- I didn't want to change more than what was required (and potentially
incur perf hits for unrelated code), but if this is a better fix I'm
happy to submit a patch.
- I think all diagnostics that can be detected from verification
failures should be reported, so I don't even think this would be correct
behavior anyway

- Adding an option for `failableParallelForEach` to still execute on
every element on the range while still returning `LogicalResult`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`failableParallelForEach` will non-deterministically early terminate
upon failure, leading to inconsistent and potentially missing
diagnostics.

This PR uses `parallelForEach` to ensure all operations are verified and
all diagnostics are handled, while tracking the failure state
separately.

Other potential fixes include:
- Making `failableParallelForEach` have deterministic early-exit
behavior (or have an option for it)
- I didn't want to change more than what was required (and potentially
incur perf hits for unrelated code), but if this is a better fix I'm
happy to submit a patch.
- I think all diagnostics that can be detected from verification
failures should be reported, so I don't even think this would be correct
behavior anyway

- Adding an option for `failableParallelForEach` to still execute on
every element on the range while still returning `LogicalResult`</pre>
</div>
</content>
</entry>
<entry>
<title>NFC: Remove unused includes (#133474)</title>
<updated>2025-03-29T00:29:56+00:00</updated>
<author>
<name>AdityaK</name>
<email>hiraditya@msn.com</email>
</author>
<published>2025-03-29T00:29:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fb0cd9899d79211a497f0b560f73d2bca67d7d9d'/>
<id>fb0cd9899d79211a497f0b560f73d2bca67d7d9d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Migrate away from PointerUnion::{is,get} (NFC) (#119802)</title>
<updated>2024-12-13T16:00:45+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-12-13T16:00:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fcb1591b46f12b8908a8cdb252611708820102f8'/>
<id>fcb1591b46f12b8908a8cdb252611708820102f8</id>
<content type='text'>
Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa&lt;T&gt;, cast&lt;T&gt; and the llvm::dyn_cast&lt;T&gt;

I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Verifier: steal bit to track seen instead of set. (#102626)</title>
<updated>2024-08-09T15:50:25+00:00</updated>
<author>
<name>Will Dietz</name>
<email>will.dietz@sifive.com</email>
</author>
<published>2024-08-09T15:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7a98071da2d3e126bacd6c004d2f5d8ecaae7819'/>
<id>7a98071da2d3e126bacd6c004d2f5d8ecaae7819</id>
<content type='text'>
Tracking a set containing every block and operation visited can become
very expensive and is unnecessary.

Co-authored-by: Will Dietz &lt;w@wdtz.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tracking a set containing every block and operation visited can become
very expensive and is unnecessary.

Co-authored-by: Will Dietz &lt;w@wdtz.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Verifier: Use a SmallPtrSet for a small set of pointers. NFC</title>
<updated>2024-07-27T11:55:04+00:00</updated>
<author>
<name>Benjamin Kramer</name>
<email>benny.kra@googlemail.com</email>
</author>
<published>2024-07-27T11:54:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ae4f2495a460d973e471626fb6fdaeec6d5c494e'/>
<id>ae4f2495a460d973e471626fb6fdaeec6d5c494e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][IR] Make verifyDominanceOfContainedRegions iterative (#74428)</title>
<updated>2023-12-05T09:06:28+00:00</updated>
<author>
<name>Hideto Ueno</name>
<email>uenoku.tokotoko@gmail.com</email>
</author>
<published>2023-12-05T09:06:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=892abd34d22076cac2be297222acb269a3d1f605'/>
<id>892abd34d22076cac2be297222acb269a3d1f605</id>
<content type='text'>
This commit refactors `verifyDominanceOfContainedRegions` to iterative
algorithms similar to https://reviews.llvm.org/D154925 to fix stack
overflow for deeply nested regions (e.g.
https://github.com/llvm/circt/issues/5316). There should be no
functional change except that this could result in slightly different
order of verification.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit refactors `verifyDominanceOfContainedRegions` to iterative
algorithms similar to https://reviews.llvm.org/D154925 to fix stack
overflow for deeply nested regions (e.g.
https://github.com/llvm/circt/issues/5316). There should be no
functional change except that this could result in slightly different
order of verification.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][IR] Rewrite OperationVerifier using worklist</title>
<updated>2023-07-12T09:05:31+00:00</updated>
<author>
<name>Alexander Shaposhnikov</name>
<email>ashaposhnikov@google.com</email>
</author>
<published>2023-07-12T08:52:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7689179ac9c4f2d6469f617b92a18b350d36b43d'/>
<id>7689179ac9c4f2d6469f617b92a18b350d36b43d</id>
<content type='text'>
This diff switches OperationVerifier to using a worklist
rather than recursion. The exception is our handling of isolated regions,
it can still contain recursive calls, however, the parallel processing
of these regions is preserved. This fixes the crash of the "verifier"
on the input from https://github.com/llvm/circt/issues/5316
(but the IR printer would still crash with stack overflow).

Test plan: ninja check-mlir check-all

Differential revision: https://reviews.llvm.org/D154925
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This diff switches OperationVerifier to using a worklist
rather than recursion. The exception is our handling of isolated regions,
it can still contain recursive calls, however, the parallel processing
of these regions is preserved. This fixes the crash of the "verifier"
on the input from https://github.com/llvm/circt/issues/5316
(but the IR printer would still crash with stack overflow).

Test plan: ninja check-mlir check-all

Differential revision: https://reviews.llvm.org/D154925
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup uses of getAttrDictionary() in MLIR to use getDiscardableAttrDictionary() when possible</title>
<updated>2023-05-15T18:35:50+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2023-05-15T05:39:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bbe5bf1788b55e3c7020d50ee0fd5956f261cfec'/>
<id>bbe5bf1788b55e3c7020d50ee0fd5956f261cfec</id>
<content type='text'>
This also speeds up some benchmarks in compiling simple fortan file by 2x!
Fixes #62687

Differential Revision: https://reviews.llvm.org/D150540
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also speeds up some benchmarks in compiling simple fortan file by 2x!
Fixes #62687

Differential Revision: https://reviews.llvm.org/D150540
</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>
</feed>
