15
15
#include " flang/Lower/Bridge.h"
16
16
#include " flang/Lower/FIRBuilder.h"
17
17
#include " flang/Lower/PFTBuilder.h"
18
+ #include " flang/Lower/Support/BoxValue.h"
18
19
#include " flang/Parser/parse-tree.h"
19
20
#include " flang/Semantics/tools.h"
20
21
#include " mlir/Dialect/OpenACC/OpenACC.h"
@@ -120,17 +121,17 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
120
121
if (const auto &gangNumValue =
121
122
std::get<std::optional<Fortran::parser::ScalarIntExpr>>(
122
123
x.t )) {
123
- gangNum = converter.genExprValue (
124
- *Fortran::semantics::GetExpr (gangNumValue.value ()));
124
+ gangNum = fir::getBase ( converter.genExprValue (
125
+ *Fortran::semantics::GetExpr (gangNumValue.value ()))) ;
125
126
}
126
127
if (const auto &gangStaticValue =
127
128
std::get<std::optional<Fortran::parser::AccSizeExpr>>(x.t )) {
128
129
const auto &expr =
129
130
std::get<std::optional<Fortran::parser::ScalarIntExpr>>(
130
131
gangStaticValue.value ().t );
131
132
if (expr) {
132
- gangStatic =
133
- converter.genExprValue (*Fortran::semantics::GetExpr (*expr));
133
+ gangStatic = fir::getBase (
134
+ converter.genExprValue (*Fortran::semantics::GetExpr (*expr))) ;
134
135
} else {
135
136
// * was passed as value and will be represented as a -1 constant
136
137
// integer.
@@ -145,16 +146,16 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
145
146
std::get_if<Fortran::parser::AccClause::Worker>(
146
147
&clause.u )) {
147
148
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 ))) ;
150
151
}
151
152
executionMapping |= mlir::acc::OpenACCExecMapping::WORKER;
152
153
} else if (const auto *vectorClause =
153
154
std::get_if<Fortran::parser::AccClause::Vector>(
154
155
&clause.u )) {
155
156
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 ))) ;
158
159
}
159
160
executionMapping |= mlir::acc::OpenACCExecMapping::VECTOR;
160
161
} else if (const auto *tileClause =
@@ -165,8 +166,8 @@ static void genACC(Fortran::lower::AbstractConverter &converter,
165
166
std::get<std::optional<Fortran::parser::ScalarIntConstantExpr>>(
166
167
accTileExpr.t );
167
168
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)))) ;
170
171
} else {
171
172
// * was passed as value and will be represented as a -1 constant
172
173
// integer.
0 commit comments