[Flang][OpenMP] Fix for unstructured regions in OpenMP constructs - 2
authorkiranchandramohan <kiranchandramohan@gmail.com>
Tue, 31 May 2022 09:25:00 +0000 (09:25 +0000)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 31 May 2022 09:25:56 +0000 (09:25 +0000)
commitb501503ca0bc5562e5ef4eb736ab718fd29c7bc3
tree42fdc6bd20bbb47e1723f5db53356f498784d6c8
parent5a2e640eb794fffeba6afa259058115d62e7b32e
[Flang][OpenMP] Fix for unstructured regions in OpenMP constructs - 2

The following changes are made for OpenMP operations with unstructured region,
1. For combined constructs the outer operation is considered a structured
region and the inner one as the unstructured.
2. Added a condition to ensure that we create new blocks only once for nested
unstructured OpenMP constructs.

Tests are added for checking the structure of the CFG.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project. Code originally reviewed
at https://github.com/flang-compiler/f18-llvm-project/pull/1394.

Reviewed By: vdonaldson, shraiysh, peixin

Differential Revision: https://reviews.llvm.org/D126375
flang/lib/Lower/OpenMP.cpp
flang/test/Lower/OpenMP/omp-unstructured.f90