[all-commits] [llvm/llvm-project] b5b3e5: [Flang] Initial lowering of the Fortran Do loop

kiranchandramohan via All-commits all-commits at lists.llvm.org
Thu Apr 28 06:07:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b5b3e50f65ee99257041723e7645d44c1aeb1117
      https://github.com/llvm/llvm-project/commit/b5b3e50f65ee99257041723e7645d44c1aeb1117
  Author: Kiran Chandramohan <kiran.chandramohan at arm.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M flang/lib/Lower/Bridge.cpp
    A flang/test/Lower/do_loop.f90

  Log Message:
  -----------
  [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: Eric Schweitz <eschweitz at nvidia.com>
Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Val Donaldson <vdonaldson at nvidia.com>
Co-authored-by: Peter Klausler <pklausler at nvidia.com>
Co-authored-by: Valentin Clement <clementval at gmail.com>




More information about the All-commits mailing list