Skip to content

Commit 726a6e8

Browse files
committed
[flang][openacc] Update Loop Construct lowering to use fir::getBase
This patch update the loop construct lowring to match fir-dev changes. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D88914
1 parent 24dd0cd commit 726a6e8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

flang/lib/Lower/OpenACC.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "flang/Lower/Bridge.h"
1616
#include "flang/Lower/FIRBuilder.h"
1717
#include "flang/Lower/PFTBuilder.h"
18+
#include "flang/Lower/Support/BoxValue.h"
1819
#include "flang/Parser/parse-tree.h"
1920
#include "flang/Semantics/tools.h"
2021
#include "mlir/Dialect/OpenACC/OpenACC.h"
@@ -120,17 +121,17 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
120121
if (const auto &gangNumValue =
121122
std::get<std::optional<Fortran::parser::ScalarIntExpr>>(
122123
x.t)) {
123-
gangNum = converter.genExprValue(
124-
*Fortran::semantics::GetExpr(gangNumValue.value()));
124+
gangNum = fir::getBase(converter.genExprValue(
125+
*Fortran::semantics::GetExpr(gangNumValue.value())));
125126
}
126127
if (const auto &gangStaticValue =
127128
std::get<std::optional<Fortran::parser::AccSizeExpr>>(x.t)) {
128129
const auto &expr =
129130
std::get<std::optional<Fortran::parser::ScalarIntExpr>>(
130131
gangStaticValue.value().t);
131132
if (expr) {
132-
gangStatic =
133-
converter.genExprValue(*Fortran::semantics::GetExpr(*expr));
133+
gangStatic = fir::getBase(
134+
converter.genExprValue(*Fortran::semantics::GetExpr(*expr)));
134135
} else {
135136
// * was passed as value and will be represented as a -1 constant
136137
// integer.
@@ -145,16 +146,16 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
145146
std::get_if<Fortran::parser::AccClause::Worker>(
146147
&clause.u)) {
147148
if (workerClause->v) {
148-
workerNum = converter.genExprValue(
149-
*Fortran::semantics::GetExpr(*workerClause->v));
149+
workerNum = fir::getBase(converter.genExprValue(
150+
*Fortran::semantics::GetExpr(*workerClause->v)));
150151
}
151152
executionMapping |= mlir::acc::OpenACCExecMapping::WORKER;
152153
} else if (const auto *vectorClause =
153154
std::get_if<Fortran::parser::AccClause::Vector>(
154155
&clause.u)) {
155156
if (vectorClause->v) {
156-
vectorLength = converter.genExprValue(
157-
*Fortran::semantics::GetExpr(*vectorClause->v));
157+
vectorLength = fir::getBase(converter.genExprValue(
158+
*Fortran::semantics::GetExpr(*vectorClause->v)));
158159
}
159160
executionMapping |= mlir::acc::OpenACCExecMapping::VECTOR;
160161
} else if (const auto *tileClause =
@@ -165,8 +166,8 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
165166
std::get<std::optional<Fortran::parser::ScalarIntConstantExpr>>(
166167
accTileExpr.t);
167168
if (expr) {
168-
tileOperands.push_back(
169-
converter.genExprValue(*Fortran::semantics::GetExpr(*expr)));
169+
tileOperands.push_back(fir::getBase(
170+
converter.genExprValue(*Fortran::semantics::GetExpr(*expr))));
170171
} else {
171172
// * was passed as value and will be represented as a -1 constant
172173
// integer.

0 commit comments

Comments
 (0)