<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/TableGen/Operator.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][tblgen] Fix bug when mixing props and InferTypes (#157367)</title>
<updated>2025-09-10T12:08:03+00:00</updated>
<author>
<name>Fabian Mora</name>
<email>fmora.dev@gmail.com</email>
</author>
<published>2025-09-10T12:08:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9465ef54067625cfbcd0dcbb0ab2991a974d51e3'/>
<id>9465ef54067625cfbcd0dcbb0ab2991a974d51e3</id>
<content type='text'>
This patch fixes a bug occurring when properties are mixed with any of
the InferType traits, causing tblgen to crash. A simple reproducer is:
```
def _TypeInferredPropOp : NS_Op&lt;"type_inferred_prop_op_with_properties", [
    AllTypesMatch&lt;["value", "result"]&gt;
  ]&gt; {
  let arguments = (ins Property&lt;"unsigned"&gt;:$prop, AnyType:$value);
  let results = (outs AnyType:$result);
  let hasCustomAssemblyFormat = 1;
}
```

The issue occurs because of the call:
```
op.getArgToOperandOrAttribute(infer.getIndex());
```
To understand better the issue, consider:
```
attrOrOperandMapping = [Operand0]
arguments = [Prop0, Operand0]
```
In this case, `infer.getIndex()` will return `1` for `Operand0`, but
`getArgToOperandOrAttribute` expects `0`, causing the discrepancy that
causes the crash.

The fix is to change `attrOrOperandMapping` to also include props.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a bug occurring when properties are mixed with any of
the InferType traits, causing tblgen to crash. A simple reproducer is:
```
def _TypeInferredPropOp : NS_Op&lt;"type_inferred_prop_op_with_properties", [
    AllTypesMatch&lt;["value", "result"]&gt;
  ]&gt; {
  let arguments = (ins Property&lt;"unsigned"&gt;:$prop, AnyType:$value);
  let results = (outs AnyType:$result);
  let hasCustomAssemblyFormat = 1;
}
```

The issue occurs because of the call:
```
op.getArgToOperandOrAttribute(infer.getIndex());
```
To understand better the issue, consider:
```
attrOrOperandMapping = [Operand0]
arguments = [Prop0, Operand0]
```
In this case, `infer.getIndex()` will return `1` for `Operand0`, but
`getArgToOperandOrAttribute` expects `0`, causing the discrepancy that
causes the crash.

The fix is to change `attrOrOperandMapping` to also include props.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Remove unused includes (NFC) (#146709)</title>
<updated>2025-07-02T16:32:39+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-07-02T16:32:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=191583c6a550778e9eeae9be9b7c985c6007f935'/>
<id>191583c6a550778e9eeae9be9b7c985c6007f935</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][Vector] Add `vector.to_elements` op (#141457)</title>
<updated>2025-06-18T20:45:43+00:00</updated>
<author>
<name>Diego Caballero</name>
<email>dieg0ca6aller0@gmail.com</email>
</author>
<published>2025-06-18T20:45:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7aecd7ecacb4b305b94149f3cfcef306a9da6beb'/>
<id>7aecd7ecacb4b305b94149f3cfcef306a9da6beb</id>
<content type='text'>
This PR introduces the `vector.to_elements` op, which decomposes a
vector into its scalar elements. This operation is symmetrical to the
existing `vector.from_elements`.

Examples:

```
    // Decompose a 0-D vector.
    %0 = vector.to_elements %v0 : vector&lt;f32&gt;
    // %0 = %v0[0]

    // Decompose a 1-D vector.
    %0:2 = vector.to_elements %v1 : vector&lt;2xf32&gt;
    // %0#0 = %v1[0]
    // %0#1 = %v1[1]

    // Decompose a 2-D.
    %0:6 = vector.to_elements %v2 : vector&lt;2x3xf32&gt;
    // %0#0 = %v2[0, 0]
    // %0#1 = %v2[0, 1]
    // %0#2 = %v2[0, 2]
    // %0#3 = %v2[1, 0]
    // %0#4 = %v2[1, 1]
    // %0#5 = %v2[1, 2]
```

This op is aimed at reducing code size when modeling "structured" vector
extractions and simplifying canonicalizations of large sequences of
`vector.extract` and `vector.insert` ops into `vector.shuffle` and other
sophisticated ops that can re-arrange vector elements.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR introduces the `vector.to_elements` op, which decomposes a
vector into its scalar elements. This operation is symmetrical to the
existing `vector.from_elements`.

Examples:

```
    // Decompose a 0-D vector.
    %0 = vector.to_elements %v0 : vector&lt;f32&gt;
    // %0 = %v0[0]

    // Decompose a 1-D vector.
    %0:2 = vector.to_elements %v1 : vector&lt;2xf32&gt;
    // %0#0 = %v1[0]
    // %0#1 = %v1[1]

    // Decompose a 2-D.
    %0:6 = vector.to_elements %v2 : vector&lt;2x3xf32&gt;
    // %0#0 = %v2[0, 0]
    // %0#1 = %v2[0, 1]
    // %0#2 = %v2[0, 2]
    // %0#3 = %v2[1, 0]
    // %0#4 = %v2[1, 1]
    // %0#5 = %v2[1, 2]
```

This op is aimed at reducing code size when modeling "structured" vector
extractions and simplifying canonicalizations of large sequences of
`vector.extract` and `vector.insert` ops into `vector.shuffle` and other
sophisticated ops that can re-arrange vector elements.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLVM][TableGen] Rename `ListInit::getValues()` to `getElements()` (#140289)</title>
<updated>2025-05-19T19:16:33+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2025-05-19T19:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3932360b14c390188977a53ecba6c13fff685aae'/>
<id>3932360b14c390188977a53ecba6c13fff685aae</id>
<content type='text'>
Rename `ListInit::getValues()` to `getElements()` to better match with
other `ListInit` members like `getElement`. Keep `getValues()` for
existing downstream code but mark it deprecated.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename `ListInit::getValues()` to `getElements()` to better match with
other `ListInit` members like `getElement`. Keep `getValues()` for
existing downstream code but mark it deprecated.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][TableGen] Use arg index in InferredResultType constructor. (#122717)</title>
<updated>2025-01-13T16:05:26+00:00</updated>
<author>
<name>Philipp Schilk</name>
<email>schilk.philipp@gmail.com</email>
</author>
<published>2025-01-13T16:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7aebacbee965a83c5cc69f6a723605436651672c'/>
<id>7aebacbee965a83c5cc69f6a723605436651672c</id>
<content type='text'>
Trying to constrain two results to be of the same type using
`AllTypesMatch` would cause `mlir-tablgen` to crash on this
assertion[1].

Example:

```tblgen
def OpL5 : NS_Op&lt;"op_with_same_but_unconstraint_results",
    [AllTypesMatch&lt;["result_a", "result_b"]&gt;]&gt; {
  let results = (outs AnyType:$result_a, AnyType:$result_b);
}
```

This is because there was a small bug when constructing the `inferences`
graph from these constraints: The sources should be specified by the
combined arg/result index (in other words, with results negative) not
with the result index.


[1]
https://github.com/llvm/llvm-project/blob/99612a3a18e0c40aac9c52b68e67b106f97ed4fa/mlir/lib/TableGen/Operator.cpp#L526</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trying to constrain two results to be of the same type using
`AllTypesMatch` would cause `mlir-tablgen` to crash on this
assertion[1].

Example:

```tblgen
def OpL5 : NS_Op&lt;"op_with_same_but_unconstraint_results",
    [AllTypesMatch&lt;["result_a", "result_b"]&gt;]&gt; {
  let results = (outs AnyType:$result_a, AnyType:$result_b);
}
```

This is because there was a small bug when constructing the `inferences`
graph from these constraints: The sources should be specified by the
combined arg/result index (in other words, with results negative) not
with the result index.


[1]
https://github.com/llvm/llvm-project/blob/99612a3a18e0c40aac9c52b68e67b106f97ed4fa/mlir/lib/TableGen/Operator.cpp#L526</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Migrate away from PointerUnion::{is,get} (NFC) (#122569)</title>
<updated>2025-01-11T08:17:40+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-01-11T08:17:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=26d513d197e14b824dd9d353aff38af1925c3770'/>
<id>26d513d197e14b824dd9d353aff38af1925c3770</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;</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;</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][MLIR][TableGen] Eliminate `llvm::` for commonly used types (#112456)</title>
<updated>2024-10-18T21:26:57+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-10-18T21:26:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=659192b1843c4af180700783caca4cdc7afa3eab'/>
<id>659192b1843c4af180700783caca4cdc7afa3eab</id>
<content type='text'>
Eliminate `llvm::` namespace qualifier for commonly used types in MLIR
TableGen backends to reduce code clutter.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eliminate `llvm::` namespace qualifier for commonly used types in MLIR
TableGen backends to reduce code clutter.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][TableGen] Use const pointers for various `Init` objects (#112562)</title>
<updated>2024-10-16T18:46:38+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-10-16T18:46:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e768b076e3b7ed38485a29244a0b989076e4b131'/>
<id>e768b076e3b7ed38485a29244a0b989076e4b131</id>
<content type='text'>
This reverts commit 0eed3055511381436ee69d1caf64a4af47f8d65c and applies
additional fixes in `verifyArgument` in OmpOpGen.cpp for gcc-7 bot
failures</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 0eed3055511381436ee69d1caf64a4af47f8d65c and applies
additional fixes in `verifyArgument` in OmpOpGen.cpp for gcc-7 bot
failures</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[MLIR][TableGen] Use const pointers for various `Init` objects" (#112506)</title>
<updated>2024-10-16T09:09:17+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2024-10-16T09:09:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0eed3055511381436ee69d1caf64a4af47f8d65c'/>
<id>0eed3055511381436ee69d1caf64a4af47f8d65c</id>
<content type='text'>
Reverts llvm/llvm-project#112316

Bots are failing.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#112316

Bots are failing.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][TableGen] Use const pointers for various `Init` objects (#112316)</title>
<updated>2024-10-15T06:48:12+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-10-15T06:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1ae9fe5ea0c502195f0c857759e2277ba9c8b338'/>
<id>1ae9fe5ea0c502195f0c857759e2277ba9c8b338</id>
<content type='text'>
Use const pointers for various `Init` objects. This is a part of effort
to have better const correctness in TableGen backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use const pointers for various `Init` objects. This is a part of effort
to have better const correctness in TableGen backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089</pre>
</div>
</content>
</entry>
</feed>
