[PATCH] D118983: [Flang] Add support for lowering the goto statement

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 4 02:58:25 PST 2022


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

This patch adds support for lowering the Fortran goto statement from
parse-tree to MLIR. The goto statement in Fortran is a form of
unstructured control flow. The statement transfers control to the
code starting at the label specified in the statement. This can be
faithfully represented in MLIR by a branch instruction.

To assist the lowering of code with unstructured control flow, blocks
are created in advance and associated with the relevant pre-fir tree
evaluations.

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

[1] https://github.com/flang-compiler/f18-llvm-project

Originally written by:
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/D118983

Files:
  flang/lib/Lower/Bridge.cpp
  flang/test/Lower/goto-statement.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118983.405907.patch
Type: text/x-patch
Size: 6912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220204/684162e3/attachment.bin>


More information about the llvm-commits mailing list