[all-commits] [llvm/llvm-project] 7aebac: [MLIR][TableGen] Use arg index in InferredResultTy...

Philipp Schilk via All-commits all-commits at lists.llvm.org
Mon Jan 13 08:05:48 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7aebacbee965a83c5cc69f6a723605436651672c
      https://github.com/llvm/llvm-project/commit/7aebacbee965a83c5cc69f6a723605436651672c
  Author: Philipp Schilk <schilk.philipp at gmail.com>
  Date:   2025-01-13 (Mon, 13 Jan 2025)

  Changed paths:
    M mlir/lib/TableGen/Operator.cpp
    M mlir/test/mlir-tblgen/op-result.td

  Log Message:
  -----------
  [MLIR][TableGen] Use arg index in InferredResultType constructor. (#122717)

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<"op_with_same_but_unconstraint_results",
    [AllTypesMatch<["result_a", "result_b"]>]> {
  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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list