[PATCH] D114159: [flang][codegen] Add a conversion for `fir.coordinate_of` - part 1

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 06:08:26 PST 2021


awarzynski created this revision.
awarzynski added reviewers: clementval, kiranchandramohan, schweitz, rovka, jeanPerier, vdonaldson.
Herald added subscribers: Chia-hungDuan, mehdi_amini, rriddle.
Herald added a project: Flang.
awarzynski requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, jdoerfert.
Herald added a project: LLVM.

This patch extends the `FIRToLLVMLowering` pass in Flang by adding a
hook to transform `fir.coordinate_of` into a sequence of LLVM MLIR
instructions.

The following cases are currently supported:

1. the input object is a `fir.complex` (wrapped in e.g. `fir.ref` or `fir.box`)
2. the input object is wrapped in a `fir.box` (including e.g. `fir.array`).

Note that `fir.complex` wrapped in a `fir.box` falls under case 1. above
(i.e. it's a special case regardless of the wrapping type). Sequence
types are not yet supported (e.g. `fir.array` that is _not wrapped_ with
`fir.box`).

This is part of the upstreaming effort from the `fir-dev` branch in [1].

Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz at nvidia.com>
Co-authored-by: V Donaldson <vdonaldson at nvidia.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114159

Files:
  flang/lib/Optimizer/CodeGen/CodeGen.cpp
  flang/test/Fir/convert-to-llvm-invalid.fir
  flang/test/Fir/convert-to-llvm.fir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114159.388175.patch
Type: text/x-patch
Size: 27056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211118/0487ec72/attachment.bin>


More information about the llvm-commits mailing list