[all-commits] [llvm/llvm-project] 52ca6a: [Flang][PFT] Skip continue insertion for OpenMP Loops

kiranchandramohan via All-commits all-commits at lists.llvm.org
Mon Jun 5 09:32:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52ca6ad755b0cc2aa603cfb3124bf58c04a47005
      https://github.com/llvm/llvm-project/commit/52ca6ad755b0cc2aa603cfb3124bf58c04a47005
  Author: Kiran Chandramohan <kiran.chandramohan at arm.com>
  Date:   2023-06-05 (Mon, 05 Jun 2023)

  Changed paths:
    M flang/lib/Lower/PFTBuilder.cpp
    A flang/test/Lower/OpenMP/pre-fir-tree-loop.f90

  Log Message:
  -----------
  [Flang][PFT] Skip continue insertion for OpenMP Loops

Unstructured regions presents some issues for OpenMP code generation.
While there are no branches out of the OpenMP region, there can be
branches inside. This required the availability of an artificial
target at the end of an OpenMP region. This was implemented by
insertion an artifical `continue` and marking it as a target for
a branch.
(https://github.com/flang-compiler/f18-llvm-project/pull/1178)

The artificial target is not required for OpenMP loops. Since the
DO loop end can itself be a target of a branch. Moreover, insertion
of the continue between the end of the loop and the end of the
OpenMP loop construct presents problems since the OpenMP MLIR
loop construct models both the loop and the construct. This can
cause the terminator of the OpenMP loop construct to be missed.
This patch solves the issue by skipping the insertion of the
continue.

Note: This issue is only hit if the `end openmp loop` directive
is missed.

This patch fixes the issues in:
-> https://github.com/llvm/llvm-project/issues/58378
-> https://github.com/flang-compiler/f18-llvm-project/issues/1426

Fixes #58378

Reviewed By: vdonaldson

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




More information about the All-commits mailing list