Similarly to scf::ForOp, introduce additional function_ref arguments to
::build functions of SCF ParallelOp and ReduceOp. The provided functions
will be called to construct the body of the respective operations while
constructing the operation itself. Exercise them in LoopUtils.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
thanks, Alex!
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
541 | nit: will smth like that work? function_ref<void(OpBuilder &, Location, ValueRange, ValueRange)> wrapper; if (bodyBuilderFn) { wrapper = [&bodyBuilderFn](OpBuilder &nestedBuilder, Location nestedLoc, ValueRange ivs, ValueRange) { bodyBuilderFn(nestedBuilder, nestedLoc, ivs); }; } build(builder, result, lowerBounds, upperBounds, steps, ValueRange(), wrapper); |
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
541 | This way, the wrapper will refer to a temporary scoped within the if block, so it will become dangling after that. I'll factor out the lambda into a function-level variable to help readability. |
nit: will smth like that work?