[MLIR][NFC] Adopt FuncOp/Region argument API's.
- Use FuncOp::getArguments() and Region::getArguments() and friends where possible instead of going through the front() block. PiperOrigin-RevId: 325352975
This commit is contained in:
parent
cd22ecd136
commit
a6978cf4ab
|
@ -147,9 +147,9 @@ class LhloReduceToGPULaunchConverter : public OpConversionPattern<ReduceOp> {
|
||||||
// Now copy over the actual body of the reduction, leaving out the
|
// Now copy over the actual body of the reduction, leaving out the
|
||||||
// terminator.
|
// terminator.
|
||||||
BlockAndValueMapping mapping;
|
BlockAndValueMapping mapping;
|
||||||
mapping.map(reduce_op.body().front().getArgument(0), accumulator);
|
mapping.map(reduce_op.body().getArgument(0), accumulator);
|
||||||
mapping.map(reduce_op.body().front().getArgument(1), rhs);
|
mapping.map(reduce_op.body().getArgument(1), rhs);
|
||||||
mapping.map(reduce_op.body().front().getArgument(2), accumulator);
|
mapping.map(reduce_op.body().getArgument(2), accumulator);
|
||||||
for (auto& nested : reduce_op.body().front().without_terminator()) {
|
for (auto& nested : reduce_op.body().front().without_terminator()) {
|
||||||
auto clone = rewriter.clone(nested, mapping);
|
auto clone = rewriter.clone(nested, mapping);
|
||||||
for (auto pair : llvm::zip(nested.getResults(), clone->getResults())) {
|
for (auto pair : llvm::zip(nested.getResults(), clone->getResults())) {
|
||||||
|
|
Loading…
Reference in New Issue