@@ -1125,22 +1125,19 @@ convertOmpWsloop(
1125
1125
tempTerminator->eraseFromParent ();
1126
1126
builder.restoreIP (nextInsertionPoint);
1127
1127
1128
- if (!ompBuilder->Config .isGPU ())
1129
- ompBuilder->RIManager .clear ();
1130
-
1131
1128
return success ();
1132
1129
}
1133
1130
1134
1131
static LogicalResult
1135
- convertOmpWsLoop (Operation &opInst, llvm::IRBuilderBase &builder,
1132
+ convertOmpWsloop (Operation &opInst, llvm::IRBuilderBase &builder,
1136
1133
LLVM::ModuleTranslation &moduleTranslation) {
1137
1134
llvm::OpenMPIRBuilder::InsertPointTy redAllocaIP =
1138
1135
findAllocaInsertPoint (builder, moduleTranslation);
1139
1136
SmallVector<OwningReductionGen> owningReductionGens;
1140
1137
SmallVector<OwningAtomicReductionGen> owningAtomicReductionGens;
1141
1138
SmallVector<llvm::OpenMPIRBuilder::ReductionInfo> reductionInfos;
1142
1139
1143
- return convertOmpWsLoop (opInst, builder, moduleTranslation, redAllocaIP,
1140
+ return convertOmpWsloop (opInst, builder, moduleTranslation, redAllocaIP,
1144
1141
owningReductionGens, owningAtomicReductionGens,
1145
1142
reductionInfos);
1146
1143
}
@@ -1414,9 +1411,6 @@ convertOmpParallel(Operation &opInst1, llvm::IRBuilderBase &builder,
1414
1411
ompBuilder->createParallel (ompLoc, allocaIP, bodyGenCB, privCB, finiCB,
1415
1412
ifCond, numThreads, pbKind, isCancellable));
1416
1413
1417
- if (!ompBuilder->Config .isGPU ())
1418
- ompBuilder->RIManager .clear ();
1419
-
1420
1414
return bodyGenStatus;
1421
1415
}
1422
1416
@@ -3330,10 +3324,9 @@ class ConversionDispatchList {
3330
3324
}
3331
3325
};
3332
3326
3333
- static LogicalResult convertOmpDistributeParallelWsLoop (
3334
- Operation *op,
3335
- omp::DistributeOp distribute, omp::ParallelOp parallel,
3336
- omp::WsLoopOp wsloop, llvm::IRBuilderBase &builder,
3327
+ static LogicalResult convertOmpDistributeParallelWsloop (
3328
+ Operation *op, omp::DistributeOp distribute, omp::ParallelOp parallel,
3329
+ omp::WsloopOp wsloop, llvm::IRBuilderBase &builder,
3337
3330
LLVM::ModuleTranslation &moduleTranslation,
3338
3331
ConversionDispatchList &dispatchList);
3339
3332
@@ -3534,10 +3527,10 @@ convertInternalTargetOp(Operation *op, llvm::IRBuilderBase &builder,
3534
3527
3535
3528
omp::DistributeOp distribute;
3536
3529
omp::ParallelOp parallel;
3537
- omp::WsLoopOp wsloop;
3530
+ omp::WsloopOp wsloop;
3538
3531
// Match composite constructs
3539
3532
if (matchOpNest (op, distribute, parallel, wsloop)) {
3540
- return convertOmpDistributeParallelWsLoop (op, distribute, parallel, wsloop,
3533
+ return convertOmpDistributeParallelWsloop (op, distribute, parallel, wsloop,
3541
3534
builder, moduleTranslation,
3542
3535
dispatchList);
3543
3536
}
@@ -3586,9 +3579,9 @@ class OpenMPDialectLLVMIRTranslationInterface
3586
3579
// Implementation converting a nest of operations in a single function. This
3587
3580
// just overrides the parallel and wsloop dispatches but does the normal
3588
3581
// lowering for now.
3589
- static LogicalResult convertOmpDistributeParallelWsLoop (
3582
+ static LogicalResult convertOmpDistributeParallelWsloop (
3590
3583
Operation *op, omp::DistributeOp distribute, omp::ParallelOp parallel,
3591
- omp::WsLoopOp wsloop, llvm::IRBuilderBase &builder,
3584
+ omp::WsloopOp wsloop, llvm::IRBuilderBase &builder,
3592
3585
LLVM::ModuleTranslation &moduleTranslation,
3593
3586
ConversionDispatchList &dispatchList) {
3594
3587
@@ -3599,25 +3592,22 @@ static LogicalResult convertOmpDistributeParallelWsLoop(
3599
3592
llvm::OpenMPIRBuilder::InsertPointTy redAllocaIP;
3600
3593
3601
3594
// Convert wsloop alternative implementation
3602
- ConvertFunctionTy convertWsLoop = [&redAllocaIP, &owningReductionGens,
3603
- &owningAtomicReductionGens,
3604
- &reductionInfos](
3605
- Operation *op,
3606
- llvm::IRBuilderBase &builder,
3607
- LLVM::ModuleTranslation
3608
- &moduleTranslation) {
3609
- if (!isa<omp::WsLoopOp>(op)) {
3610
- return std::make_pair (false , failure ());
3611
- }
3595
+ ConvertFunctionTy convertWsloop =
3596
+ [&redAllocaIP, &owningReductionGens, &owningAtomicReductionGens,
3597
+ &reductionInfos](Operation *op, llvm::IRBuilderBase &builder,
3598
+ LLVM::ModuleTranslation &moduleTranslation) {
3599
+ if (!isa<omp::WsloopOp>(op)) {
3600
+ return std::make_pair (false , failure ());
3601
+ }
3612
3602
3613
- LogicalResult result = convertOmpWsLoop (
3614
- *op, builder, moduleTranslation, redAllocaIP, owningReductionGens,
3615
- owningAtomicReductionGens, reductionInfos);
3616
- return std::make_pair (true , result);
3617
- };
3603
+ LogicalResult result = convertOmpWsloop (
3604
+ *op, builder, moduleTranslation, redAllocaIP, owningReductionGens,
3605
+ owningAtomicReductionGens, reductionInfos);
3606
+ return std::make_pair (true , result);
3607
+ };
3618
3608
3619
3609
// Push the new alternative functions
3620
- dispatchList.pushConversionFunction (convertWsLoop );
3610
+ dispatchList.pushConversionFunction (convertWsloop );
3621
3611
3622
3612
// Lower the current distribute operation
3623
3613
LogicalResult result = convertOmpDistribute (*op, builder, moduleTranslation,
0 commit comments