Skip to content

Commit 5eaee02

Browse files
committed
Fix typo and runtimeCall funcName
1 parent 6af7be3 commit 5eaee02

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

flang/lib/Optimizer/OpenMP/LowerWorkdistribute.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool shouldParallelize(Operation *op) {
8383
// True if the op is a runtime call to Assign
8484
if (isRuntimeCall(op)) {
8585
fir::CallOp runtimeCall = cast<fir::CallOp>(op);
86-
auto funcName = (*runtimeCall.getCallee()).getRootReference().getValue();
86+
auto funcName = runtimeCall.getCallee()->getRootReference().getValue();
8787
if (funcName == FortranAssignStr) {
8888
return true;
8989
}
@@ -354,7 +354,6 @@ static void genWsLoopOp(mlir::OpBuilder &rewriter, fir::DoLoopOp doLoop,
354354
rewriter.create<mlir::omp::YieldOp>(doLoop->getLoc());
355355
terminatorOp->erase();
356356
}
357-
return;
358357
}
359358

360359
/// workdistributeDoLower method finds the fir.do_loop unoredered
@@ -621,13 +620,10 @@ workdistributeRuntimeCallLower(omp::WorkdistributeOp workdistribute,
621620
targetOp = dyn_cast<omp::TargetOp>(teams->getParentOp());
622621
SmallVector<Operation *> opsToErase;
623622
for (auto &op : workdistribute.getOps()) {
624-
if (&op == terminator) {
625-
break;
626-
}
627623
if (isRuntimeCall(&op)) {
628624
rewriter.setInsertionPoint(&op);
629625
fir::CallOp runtimeCall = cast<fir::CallOp>(op);
630-
auto funcName = (*runtimeCall.getCallee()).getRootReference().getValue();
626+
auto funcName = runtimeCall.getCallee()->getRootReference().getValue();
631627
if (funcName == FortranAssignStr) {
632628
if (isFortranAssignSrcScalarAndDestArray(runtimeCall) && targetOp) {
633629
// Record the target ops to process later
@@ -786,7 +782,7 @@ FailureOr<omp::TargetOp> splitTargetData(omp::TargetOp targetOp,
786782
/// getNestedOpToIsolate function is designed to identify a specific teams
787783
/// parallel op within the body of an omp::TargetOp that should be "isolated."
788784
/// This returns a tuple of op, if its first op in targetBlock, or if the op is
789-
/// last op in the tragte block.
785+
/// last op in the traget block.
790786
static std::optional<std::tuple<Operation *, bool, bool>>
791787
getNestedOpToIsolate(omp::TargetOp targetOp) {
792788
if (targetOp.getRegion().empty())
@@ -1350,7 +1346,7 @@ static LogicalResult moveToHost(omp::TargetOp targetOp, RewriterBase &rewriter,
13501346
// Check for runtime calls to be replaced.
13511347
if (isRuntimeCall(clonedOp)) {
13521348
fir::CallOp runtimeCall = cast<fir::CallOp>(op);
1353-
auto funcName = (*runtimeCall.getCallee()).getRootReference().getValue();
1349+
auto funcName = runtimeCall.getCallee()->getRootReference().getValue();
13541350
if (funcName == FortranAssignStr) {
13551351
opsToReplace.push_back(clonedOp);
13561352
} else {
@@ -1398,7 +1394,7 @@ static LogicalResult moveToHost(omp::TargetOp targetOp, RewriterBase &rewriter,
13981394
// Replace runtime calls with omp versions.
13991395
else if (isRuntimeCall(op)) {
14001396
fir::CallOp runtimeCall = cast<fir::CallOp>(op);
1401-
auto funcName = (*runtimeCall.getCallee()).getRootReference().getValue();
1397+
auto funcName = runtimeCall.getCallee()->getRootReference().getValue();
14021398
if (funcName == FortranAssignStr) {
14031399
rewriter.setInsertionPoint(op);
14041400
fir::FirOpBuilder builder{rewriter, op};

0 commit comments

Comments
 (0)