Skip to content
Commit b5b3e50f authored by Kiran Chandramohan's avatar Kiran Chandramohan
Browse files

[Flang] Initial lowering of the Fortran Do loop

This patch adds code to lower simple Fortran Do loops with loop control.
Lowering is performed by the the `genFIR` function when called with a
`Fortran::parser::DoConstruct`. `genFIR` function calls `genFIRIncrementLoopBegin`
then calls functions to lower the body of the loop and finally calls
the function `genFIRIncrementLoopEnd`. `genFIRIncrementLoopBegin` is
responsible for creating the FIR `do_loop` as well as storing the value of
the loop index to the loop variable. `genFIRIncrementLoopEnd` returns
the incremented value of the loop index and also stores the index value
outside the loop. This is important since the loop variable can be used
outside the loop. Information about a loop is collected in a structure
`IncrementLoopInfo`.

Note 1: Future patches will bring in lowering for unstructured,
infinite, while loops
Note 2: This patch is part of upstreaming code from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D124277



Co-authored-by: default avatarEric Schweitz <eschweitz@nvidia.com>
Co-authored-by: default avatarJean Perier <jperier@nvidia.com>
Co-authored-by: default avatarVal Donaldson <vdonaldson@nvidia.com>
Co-authored-by: default avatarPeter Klausler <pklausler@nvidia.com>
Co-authored-by: default avatarValentin Clement <clementval@gmail.com>
parent 3f2b76ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment