@@ -187,13 +187,13 @@ static void convertLoopBounds(lower::AbstractConverter &converter,
187
187
// The types of lower bound, upper bound, and step are converted into the
188
188
// type of the loop variable if necessary.
189
189
mlir::Type loopVarType = getLoopVarType (converter, loopVarTypeSize);
190
- for (unsigned it = 0 ; it < (unsigned )result.loopLBVar .size (); it++) {
191
- result.loopLBVar [it] =
192
- firOpBuilder. createConvert ( loc, loopVarType, result.loopLBVar [it]);
193
- result.loopUBVar [it] =
194
- firOpBuilder. createConvert ( loc, loopVarType, result.loopUBVar [it]);
195
- result.loopStepVar [it] =
196
- firOpBuilder.createConvert (loc, loopVarType, result.loopStepVar [it]);
190
+ for (unsigned it = 0 ; it < (unsigned )result.collapseLowerBound .size (); it++) {
191
+ result.collapseLowerBound [it] = firOpBuilder. createConvert (
192
+ loc, loopVarType, result.collapseLowerBound [it]);
193
+ result.collapseUpperBound [it] = firOpBuilder. createConvert (
194
+ loc, loopVarType, result.collapseUpperBound [it]);
195
+ result.collapseStep [it] =
196
+ firOpBuilder.createConvert (loc, loopVarType, result.collapseStep [it]);
197
197
}
198
198
}
199
199
@@ -232,15 +232,15 @@ bool ClauseProcessor::processCollapse(
232
232
std::get_if<parser::LoopControl::Bounds>(&loopControl->u );
233
233
assert (bounds && " Expected bounds for worksharing do loop" );
234
234
lower::StatementContext stmtCtx;
235
- result.loopLBVar .push_back (fir::getBase (
235
+ result.collapseLowerBound .push_back (fir::getBase (
236
236
converter.genExprValue (*semantics::GetExpr (bounds->lower ), stmtCtx)));
237
- result.loopUBVar .push_back (fir::getBase (
237
+ result.collapseUpperBound .push_back (fir::getBase (
238
238
converter.genExprValue (*semantics::GetExpr (bounds->upper ), stmtCtx)));
239
239
if (bounds->step ) {
240
- result.loopStepVar .push_back (fir::getBase (
240
+ result.collapseStep .push_back (fir::getBase (
241
241
converter.genExprValue (*semantics::GetExpr (bounds->step ), stmtCtx)));
242
242
} else { // If `step` is not present, assume it as `1`.
243
- result.loopStepVar .push_back (firOpBuilder.createIntegerConstant (
243
+ result.collapseStep .push_back (firOpBuilder.createIntegerConstant (
244
244
currentLocation, firOpBuilder.getIntegerType (32 ), 1 ));
245
245
}
246
246
iv.push_back (bounds->name .thing .symbol );
@@ -291,8 +291,7 @@ bool ClauseProcessor::processDevice(lower::StatementContext &stmtCtx,
291
291
}
292
292
}
293
293
const auto &deviceExpr = std::get<omp::SomeExpr>(clause->t );
294
- result.deviceVar =
295
- fir::getBase (converter.genExprValue (deviceExpr, stmtCtx));
294
+ result.device = fir::getBase (converter.genExprValue (deviceExpr, stmtCtx));
296
295
return true ;
297
296
}
298
297
return false ;
@@ -322,10 +321,10 @@ bool ClauseProcessor::processDistSchedule(
322
321
lower::StatementContext &stmtCtx,
323
322
mlir::omp::DistScheduleClauseOps &result) const {
324
323
if (auto *clause = findUniqueClause<omp::clause::DistSchedule>()) {
325
- result.distScheduleStaticAttr = converter.getFirOpBuilder ().getUnitAttr ();
324
+ result.distScheduleStatic = converter.getFirOpBuilder ().getUnitAttr ();
326
325
const auto &chunkSize = std::get<std::optional<ExprTy>>(clause->t );
327
326
if (chunkSize)
328
- result.distScheduleChunkSizeVar =
327
+ result.distScheduleChunkSize =
329
328
fir::getBase (converter.genExprValue (*chunkSize, stmtCtx));
330
329
return true ;
331
330
}
@@ -335,7 +334,7 @@ bool ClauseProcessor::processDistSchedule(
335
334
bool ClauseProcessor::processFilter (lower::StatementContext &stmtCtx,
336
335
mlir::omp::FilterClauseOps &result) const {
337
336
if (auto *clause = findUniqueClause<omp::clause::Filter>()) {
338
- result.filteredThreadIdVar =
337
+ result.filteredThreadId =
339
338
fir::getBase (converter.genExprValue (clause->v , stmtCtx));
340
339
return true ;
341
340
}
@@ -351,7 +350,7 @@ bool ClauseProcessor::processFinal(lower::StatementContext &stmtCtx,
351
350
352
351
mlir::Value finalVal =
353
352
fir::getBase (converter.genExprValue (clause->v , stmtCtx));
354
- result.finalVar = firOpBuilder.createConvert (
353
+ result.final = firOpBuilder.createConvert (
355
354
clauseLocation, firOpBuilder.getI1Type (), finalVal);
356
355
return true ;
357
356
}
@@ -362,19 +361,19 @@ bool ClauseProcessor::processHint(mlir::omp::HintClauseOps &result) const {
362
361
if (auto *clause = findUniqueClause<omp::clause::Hint>()) {
363
362
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
364
363
int64_t hintValue = *evaluate::ToInt64 (clause->v );
365
- result.hintAttr = firOpBuilder.getI64IntegerAttr (hintValue);
364
+ result.hint = firOpBuilder.getI64IntegerAttr (hintValue);
366
365
return true ;
367
366
}
368
367
return false ;
369
368
}
370
369
371
370
bool ClauseProcessor::processMergeable (
372
371
mlir::omp::MergeableClauseOps &result) const {
373
- return markClauseOccurrence<omp::clause::Mergeable>(result.mergeableAttr );
372
+ return markClauseOccurrence<omp::clause::Mergeable>(result.mergeable );
374
373
}
375
374
376
375
bool ClauseProcessor::processNowait (mlir::omp::NowaitClauseOps &result) const {
377
- return markClauseOccurrence<omp::clause::Nowait>(result.nowaitAttr );
376
+ return markClauseOccurrence<omp::clause::Nowait>(result.nowait );
378
377
}
379
378
380
379
bool ClauseProcessor::processNumTeams (
@@ -385,7 +384,7 @@ bool ClauseProcessor::processNumTeams(
385
384
if (auto *clause = findUniqueClause<omp::clause::NumTeams>()) {
386
385
// auto lowerBound = std::get<std::optional<ExprTy>>(clause->t);
387
386
auto &upperBound = std::get<ExprTy>(clause->t );
388
- result.numTeamsUpperVar =
387
+ result.numTeamsUpper =
389
388
fir::getBase (converter.genExprValue (upperBound, stmtCtx));
390
389
return true ;
391
390
}
@@ -397,7 +396,7 @@ bool ClauseProcessor::processNumThreads(
397
396
mlir::omp::NumThreadsClauseOps &result) const {
398
397
if (auto *clause = findUniqueClause<omp::clause::NumThreads>()) {
399
398
// OMPIRBuilder expects `NUM_THREADS` clause as a `Value`.
400
- result.numThreadsVar =
399
+ result.numThreads =
401
400
fir::getBase (converter.genExprValue (clause->v , stmtCtx));
402
401
return true ;
403
402
}
@@ -408,17 +407,17 @@ bool ClauseProcessor::processOrder(mlir::omp::OrderClauseOps &result) const {
408
407
using Order = omp::clause::Order;
409
408
if (auto *clause = findUniqueClause<Order>()) {
410
409
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
411
- result.orderAttr = mlir::omp::ClauseOrderKindAttr::get (
410
+ result.order = mlir::omp::ClauseOrderKindAttr::get (
412
411
firOpBuilder.getContext (), mlir::omp::ClauseOrderKind::Concurrent);
413
412
const auto &modifier =
414
413
std::get<std::optional<Order::OrderModifier>>(clause->t );
415
414
if (modifier && *modifier == Order::OrderModifier::Unconstrained) {
416
- result.orderModAttr = mlir::omp::OrderModifierAttr::get (
415
+ result.orderMod = mlir::omp::OrderModifierAttr::get (
417
416
firOpBuilder.getContext (), mlir::omp::OrderModifier::unconstrained);
418
417
} else {
419
418
// "If order-modifier is not unconstrained, the behavior is as if the
420
419
// reproducible modifier is present."
421
- result.orderModAttr = mlir::omp::OrderModifierAttr::get (
420
+ result.orderMod = mlir::omp::OrderModifierAttr::get (
422
421
firOpBuilder.getContext (), mlir::omp::OrderModifier::reproducible);
423
422
}
424
423
return true ;
@@ -433,7 +432,7 @@ bool ClauseProcessor::processOrdered(
433
432
int64_t orderedClauseValue = 0l ;
434
433
if (clause->v .has_value ())
435
434
orderedClauseValue = *evaluate::ToInt64 (*clause->v );
436
- result.orderedAttr = firOpBuilder.getI64IntegerAttr (orderedClauseValue);
435
+ result.ordered = firOpBuilder.getI64IntegerAttr (orderedClauseValue);
437
436
return true ;
438
437
}
439
438
return false ;
@@ -443,8 +442,7 @@ bool ClauseProcessor::processPriority(
443
442
lower::StatementContext &stmtCtx,
444
443
mlir::omp::PriorityClauseOps &result) const {
445
444
if (auto *clause = findUniqueClause<omp::clause::Priority>()) {
446
- result.priorityVar =
447
- fir::getBase (converter.genExprValue (clause->v , stmtCtx));
445
+ result.priority = fir::getBase (converter.genExprValue (clause->v , stmtCtx));
448
446
return true ;
449
447
}
450
448
return false ;
@@ -454,7 +452,7 @@ bool ClauseProcessor::processProcBind(
454
452
mlir::omp::ProcBindClauseOps &result) const {
455
453
if (auto *clause = findUniqueClause<omp::clause::ProcBind>()) {
456
454
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
457
- result.procBindKindAttr = genProcBindKindAttr (firOpBuilder, *clause);
455
+ result.procBindKind = genProcBindKindAttr (firOpBuilder, *clause);
458
456
return true ;
459
457
}
460
458
return false ;
@@ -465,7 +463,7 @@ bool ClauseProcessor::processSafelen(
465
463
if (auto *clause = findUniqueClause<omp::clause::Safelen>()) {
466
464
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
467
465
const std::optional<std::int64_t > safelenVal = evaluate::ToInt64 (clause->v );
468
- result.safelenAttr = firOpBuilder.getI64IntegerAttr (*safelenVal);
466
+ result.safelen = firOpBuilder.getI64IntegerAttr (*safelenVal);
469
467
return true ;
470
468
}
471
469
return false ;
@@ -498,19 +496,19 @@ bool ClauseProcessor::processSchedule(
498
496
break ;
499
497
}
500
498
501
- result.scheduleValAttr =
499
+ result.scheduleKind =
502
500
mlir::omp::ClauseScheduleKindAttr::get (context, scheduleKind);
503
501
504
- mlir::omp::ScheduleModifier scheduleModifier = getScheduleModifier (*clause);
505
- if (scheduleModifier != mlir::omp::ScheduleModifier::none)
506
- result.scheduleModAttr =
507
- mlir::omp::ScheduleModifierAttr::get (context, scheduleModifier );
502
+ mlir::omp::ScheduleModifier scheduleMod = getScheduleModifier (*clause);
503
+ if (scheduleMod != mlir::omp::ScheduleModifier::none)
504
+ result.scheduleMod =
505
+ mlir::omp::ScheduleModifierAttr::get (context, scheduleMod );
508
506
509
507
if (getSimdModifier (*clause) != mlir::omp::ScheduleModifier::none)
510
- result.scheduleSimdAttr = firOpBuilder.getUnitAttr ();
508
+ result.scheduleSimd = firOpBuilder.getUnitAttr ();
511
509
512
510
if (const auto &chunkExpr = std::get<omp::MaybeExpr>(clause->t ))
513
- result.scheduleChunkVar =
511
+ result.scheduleChunk =
514
512
fir::getBase (converter.genExprValue (*chunkExpr, stmtCtx));
515
513
516
514
return true ;
@@ -523,7 +521,7 @@ bool ClauseProcessor::processSimdlen(
523
521
if (auto *clause = findUniqueClause<omp::clause::Simdlen>()) {
524
522
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
525
523
const std::optional<std::int64_t > simdlenVal = evaluate::ToInt64 (clause->v );
526
- result.simdlenAttr = firOpBuilder.getI64IntegerAttr (*simdlenVal);
524
+ result.simdlen = firOpBuilder.getI64IntegerAttr (*simdlenVal);
527
525
return true ;
528
526
}
529
527
return false ;
@@ -533,15 +531,15 @@ bool ClauseProcessor::processThreadLimit(
533
531
lower::StatementContext &stmtCtx,
534
532
mlir::omp::ThreadLimitClauseOps &result) const {
535
533
if (auto *clause = findUniqueClause<omp::clause::ThreadLimit>()) {
536
- result.threadLimitVar =
534
+ result.threadLimit =
537
535
fir::getBase (converter.genExprValue (clause->v , stmtCtx));
538
536
return true ;
539
537
}
540
538
return false ;
541
539
}
542
540
543
541
bool ClauseProcessor::processUntied (mlir::omp::UntiedClauseOps &result) const {
544
- return markClauseOccurrence<omp::clause::Untied>(result.untiedAttr );
542
+ return markClauseOccurrence<omp::clause::Untied>(result.untied );
545
543
}
546
544
547
545
// ===----------------------------------------------------------------------===//
@@ -565,7 +563,7 @@ static void
565
563
addAlignedClause (lower::AbstractConverter &converter,
566
564
const omp::clause::Aligned &clause,
567
565
llvm::SmallVectorImpl<mlir::Value> &alignedVars,
568
- llvm::SmallVectorImpl<mlir::Attribute> &alignmentAttrs ) {
566
+ llvm::SmallVectorImpl<mlir::Attribute> &alignments ) {
569
567
using Aligned = omp::clause::Aligned;
570
568
lower::StatementContext stmtCtx;
571
569
mlir::IntegerAttr alignmentValueAttr;
@@ -594,7 +592,7 @@ addAlignedClause(lower::AbstractConverter &converter,
594
592
alignmentValueAttr = builder.getI64IntegerAttr (alignment);
595
593
// All the list items in a aligned clause will have same alignment
596
594
for (std::size_t i = 0 ; i < objects.size (); i++)
597
- alignmentAttrs .push_back (alignmentValueAttr);
595
+ alignments .push_back (alignmentValueAttr);
598
596
}
599
597
}
600
598
@@ -603,7 +601,7 @@ bool ClauseProcessor::processAligned(
603
601
return findRepeatableClause<omp::clause::Aligned>(
604
602
[&](const omp::clause::Aligned &clause, const parser::CharBlock &) {
605
603
addAlignedClause (converter, clause, result.alignedVars ,
606
- result.alignmentAttrs );
604
+ result.alignments );
607
605
});
608
606
}
609
607
@@ -798,7 +796,7 @@ bool ClauseProcessor::processCopyprivate(
798
796
result.copyprivateVars .push_back (cpVar);
799
797
mlir::func::FuncOp funcOp =
800
798
createCopyFunc (currentLocation, converter, cpVar.getType (), attrs);
801
- result.copyprivateFuncs .push_back (mlir::SymbolRefAttr::get (funcOp));
799
+ result.copyprivateSyms .push_back (mlir::SymbolRefAttr::get (funcOp));
802
800
};
803
801
804
802
bool hasCopyPrivate = findRepeatableClause<clause::Copyprivate>(
@@ -832,7 +830,7 @@ bool ClauseProcessor::processDepend(mlir::omp::DependClauseOps &result) const {
832
830
833
831
mlir::omp::ClauseTaskDependAttr dependTypeOperand =
834
832
genDependKindAttr (firOpBuilder, kind);
835
- result.dependTypeAttrs .append (objects.size (), dependTypeOperand);
833
+ result.dependKinds .append (objects.size (), dependTypeOperand);
836
834
837
835
for (const omp::Object &object : objects) {
838
836
assert (object.ref () && " Expecting designator" );
@@ -1037,10 +1035,9 @@ bool ClauseProcessor::processReduction(
1037
1035
1038
1036
// Copy local lists into the output.
1039
1037
llvm::copy (reductionVars, std::back_inserter (result.reductionVars ));
1040
- llvm::copy (reduceVarByRef,
1041
- std::back_inserter (result.reductionVarsByRef ));
1038
+ llvm::copy (reduceVarByRef, std::back_inserter (result.reductionByref ));
1042
1039
llvm::copy (reductionDeclSymbols,
1043
- std::back_inserter (result.reductionDeclSymbols ));
1040
+ std::back_inserter (result.reductionSyms ));
1044
1041
1045
1042
if (outReductionTypes) {
1046
1043
outReductionTypes->reserve (outReductionTypes->size () +
0 commit comments