Skip to content

Commit

Permalink
[Flang][OpenMP] Remove TODO for shared and two values of default clause
Browse files Browse the repository at this point in the history
Shared is the default behaviour in the IR, so no handling is required.
Default clause with shared or none do not require any handling since
Shared is the default behaviour in the IR and None is only required
for semantic checks.

This patch is carved out from D123930 to remove couple of false TODOs.

Reviewed By: peixin, shraiysh

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

Co-authored-by: Nimish Mishra <neelam.nimish@gmail.com>
  • Loading branch information
kiranchandramohan and NimishMishra committed Jun 29, 2022
1 parent d08522f commit 051dea8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions flang/lib/Lower/OpenMP.cpp
Expand Up @@ -611,6 +611,21 @@ genOMP(Fortran::lower::AbstractConverter &converter,
std::get_if<Fortran::parser::OmpClause::Copyin>(&clause.u)) {
// Privatisation and copyin clauses are handled elsewhere.
continue;
} else if (std::get_if<Fortran::parser::OmpClause::Shared>(&clause.u)) {
// Shared is the default behavior in the IR, so no handling is required.
continue;
} else if (const auto &defaultClause =
std::get_if<Fortran::parser::OmpClause::Default>(
&clause.u)) {
if ((defaultClause->v.v ==
Fortran::parser::OmpDefaultClause::Type::Shared) ||
(defaultClause->v.v ==
Fortran::parser::OmpDefaultClause::Type::None)) {
// Default clause with shared or none do not require any handling since
// Shared is the default behavior in the IR and None is only required
// for semantic checks.
continue;
}
} else if (std::get_if<Fortran::parser::OmpClause::Threads>(&clause.u)) {
// Nothing needs to be done for threads clause.
continue;
Expand Down

0 comments on commit 051dea8

Please sign in to comment.