Skip to content

Commit 5f665c9

Browse files
committed
[flang][fir] Small clean-up in fir_DoConcurrentLoopOp's defintion
Re-organizes the op definition a little bit and removes a method that does not add much value to the API.
1 parent 9021dbc commit 5f665c9

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,9 +3884,17 @@ def fir_DoConcurrentLoopOp : fir_Op<"do_concurrent.loop",
38843884
let hasVerifier = 1;
38853885

38863886
let extraClassDeclaration = [{
3887-
unsigned getNumInductionVars() { return getLowerBound().size(); }
3887+
unsigned getNumInductionVars() {
3888+
return getLowerBound().size();
3889+
}
38883890

3889-
unsigned getNumLocalOperands() { return getLocalVars().size(); }
3891+
unsigned getNumLocalOperands() {
3892+
return getLocalVars().size();
3893+
}
3894+
3895+
unsigned getNumReduceOperands() {
3896+
return getReduceVars().size();
3897+
}
38903898

38913899
mlir::Block::BlockArgListType getInductionVars() {
38923900
return getBody()->getArguments().slice(0, getNumInductionVars());
@@ -3906,16 +3914,6 @@ def fir_DoConcurrentLoopOp : fir_Op<"do_concurrent.loop",
39063914
/// Number of operands controlling the loop
39073915
unsigned getNumControlOperands() { return getLowerBound().size() * 3; }
39083916

3909-
// Get Number of reduction operands
3910-
unsigned getNumReduceOperands() {
3911-
return getReduceVars().size();
3912-
}
3913-
3914-
mlir::Operation::operand_range getLocalOperands() {
3915-
return getOperands()
3916-
.slice(getNumControlOperands() + getNumReduceOperands(),
3917-
getNumLocalOperands());
3918-
}
39193917
}];
39203918
}
39213919

flang/lib/Optimizer/OpenMP/DoConcurrentConversion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ class DoConcurrentConversion
314314

315315
// For `local` (and `local_init`) opernads, emit corresponding `private`
316316
// clauses and attach these clauses to the workshare loop.
317-
if (!loop.getLocalOperands().empty())
317+
if (!loop.getLocalVars().empty())
318318
for (auto [op, sym, arg] : llvm::zip_equal(
319-
loop.getLocalOperands(),
319+
loop.getLocalVars(),
320320
loop.getLocalSymsAttr().getAsRange<mlir::SymbolRefAttr>(),
321321
loop.getRegionLocalArgs())) {
322322
auto localizer = mlir::SymbolTable::lookupNearestSymbolFrom<

0 commit comments

Comments
 (0)