This patterns tries to convert an inner (outer) dim reduction to an
outer (inner) dim reduction. Doing this on a 1D or 0D vector results
in an infinite loop since the converted op is same as the original
operation. Just returning failure when source rank <= 1 fixes the
issue.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir | ||
---|---|---|
165 | nit: You could make it a negative test and check that op is unchanged: |
mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir | ||
---|---|---|
165 | That was the hope, but the pass adds many different patterns and the op is changed (in ways that are not great). So this at least tests there is no infinite loop. |
nit: You could make it a negative test and check that op is unchanged:
// CHECK: vector.multi_reduction #vector.kind<maxf>, %{{.*}} [0] : vector<2xf32> to f32