Skip to content

Commit 26f4359

Browse files
committed
handle review comments
1 parent 90e3c13 commit 26f4359

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

flang/include/flang/Optimizer/HLFIR/HLFIROps.td

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,21 +1961,9 @@ def hlfir_DoConcurrentLoopOp : hlfir_Op<"do_concurrent.loop",
19611961
let hasVerifier = 1;
19621962

19631963
let extraClassDeclaration = [{
1964-
/// Get Number of variadic operands
1965-
unsigned getNumOperands(unsigned segmentIdx) {
1966-
auto segments = (*this)->getAttrOfType<mlir::DenseI32ArrayAttr>(
1967-
getOperandSegmentSizeAttr());
1968-
return static_cast<unsigned>(segments[segmentIdx]);
1969-
}
1970-
19711964
// Get Number of reduction operands
19721965
unsigned getNumReduceOperands() {
1973-
return getNumOperands(3);
1974-
}
1975-
1976-
/// Does the operation hold operands for reduction variables
1977-
bool hasReduceOperands() {
1978-
return getNumReduceOperands() > 0;
1966+
return getReduceOperands().size();
19791967
}
19801968
}];
19811969
}

flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2352,7 +2352,7 @@ void hlfir::DoConcurrentLoopOp::print(mlir::OpAsmPrinter &p) {
23522352
p << " (" << getBody()->getArguments() << ") = (" << getLowerBound()
23532353
<< ") to (" << getUpperBound() << ") step (" << getStep() << ")";
23542354

2355-
if (hasReduceOperands()) {
2355+
if (!getReduceOperands().empty()) {
23562356
p << " reduce(";
23572357
auto attrs = getReduceAttrsAttr();
23582358
auto operands = getReduceOperands();

0 commit comments

Comments
 (0)