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