[Mlir-commits] [mlir] [mlir] Handle NativeCodeCallVoid in result patterns. (PR #65804)

Jacques Pienaar llvmlistbot at llvm.org
Mon Sep 11 08:54:18 PDT 2023


jpienaar wrote:

The pattern looks wrong though, from PatternBase.td

```
  // ... In the case of more result patterns
  // than needed to replace the source op, only the last N results generated
  // by the last N result pattern is used to replace a N-result source op.
```

so in 

```
def AddToAddV2 : Pattern<
(TF_AddOp TF_NumberTensor:$arg0, TF_NumberTensor:$arg1),
[(TF_AddV2Op $arg0, $arg1), (Foo)]>;
```

`TF_AddOp` should be replaced by what `Foo` produces (that's a requirement of DRR that these match), and so `Foo` should be returning a result here of the same type as `TF_AddOp`.

https://github.com/llvm/llvm-project/pull/65804


More information about the Mlir-commits mailing list