Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/LoopOps/LoopOps.td | ||
---|---|---|
188 | Isn't a loop always supposed to capture as operands the same types as the returned values? If so then why do we have a builder with resultTypes? I'd expect these to be inferred from the captured operands? It is a problem with the current reduce, which does not model this, but that's a bug to fix right? And so adding a builder around the incorrect design does not seem right to me. |
mlir/include/mlir/Dialect/LoopOps/LoopOps.td | ||
---|---|---|
246 | Then the documentation is quite confusing: mlir %zero = constant 0.0 : f32 loop.reduce(%zero) { ^bb0(%lhs : f32, %rhs: f32): %res = addf %lhs, %rhs : f32 loop.reduce.return %res : f32 } : f32 Looking at %zero I would assume that it is the initial value of the accumulator. I'll fix it. |
mlir/include/mlir/Dialect/LoopOps/LoopOps.td | ||
---|---|---|
188 | Ploops don't really capture any operands from which we can infer result types. The result types correspond to the ReduceOps in the body of the ploop. |
mlir/include/mlir/Dialect/LoopOps/LoopOps.td | ||
---|---|---|
188 | We have not added neutral values that can be used as initial values to parallel loops, yet, and I am not sure whether they should be mandatory. Having neutral values unlocks some additional reduction schemes but they are not always necessary. If we make them optional, we will need to provide return types to support that. |
mlir/include/mlir/Dialect/LoopOps/LoopOps.td | ||
---|---|---|
188 | I thought we discussed this and it would be added? |
@mehdi_amini @nicolasvasilache I am working on a PR that passes initial values to loop.parallel. After that PR this new builder won't be needed.
Isn't a loop always supposed to capture as operands the same types as the returned values? If so then why do we have a builder with resultTypes? I'd expect these to be inferred from the captured operands?
It is a problem with the current reduce, which does not model this, but that's a bug to fix right? And so adding a builder around the incorrect design does not seem right to me.