This patch adds the ZeroOpConversion pattern to LLVM IR dialect.
Conversion of aggregate types is not implemented yet and will trigger a
failure to legalize the operation. This is tested in the
convert-to-llvm-invalid.fir test file.
This patch is part of the upstreaming effort from fir-dev branch.
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Nit: in general Patterns aren't supposed to emit errors directly but to wrap the message in notifyFailure(...).
The conversion may still succeed if another pattern ends up folding this op (or matching it), so having an error can be confusing.
In general if we want end-use diagnostic, it is best to use other mechanism (like using the partial conversion which has an extra argument for collecting "unconvertedOps").