Page MenuHomePhabricator

[flang][openacc] Remove duplicated code for clause lowering
AcceptedPublic

Authored by clementval on Nov 24 2020, 4:25 PM.

Details

Summary

This patch remove some duplicated code for the clauses
lowering in different construct and ass some minor homogenization
in the OpenACC loweing code.

This code was part of the PR #558 on fir-dev
https://github.com/flang-compiler/f18-llvm-project/pull/558

Diff Detail

Event Timeline

clementval created this revision.Nov 24 2020, 4:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2020, 4:25 PM
clementval requested review of this revision.Nov 24 2020, 4:25 PM
clementval added a project: Restricted Project.Nov 24 2020, 4:30 PM
schweitz accepted this revision.Mon, Jan 4, 4:59 PM

LGTM.

flang/lib/Lower/OpenACC.cpp
26

I think the prevailing style throughout LLVM, Clang, MLIR is to write the initializer as = -1;

Does it make sense to put this in a header file?

129

Could fold these two lines as

if (asyncClause->v.has_value())
146

Should the type of expr be cast to index here to be consistent with star (in the else branch)?

This revision is now accepted and ready to land.Mon, Jan 4, 4:59 PM