This pattern is useful for SPIR-V to unroll to a supported vector size
before later lowerings. The unrolling pattern is closer to an
elementwise op than the transfer ops because the index values from which
to extract elements are captured by the index vector and thus there is
no need to update the base offsets when unrolling gather.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
(I assume you're referring to FlattenGather in LowerVectorGather.cpp?) Yes, the pattern here is essentially a generalization of that one, with the exception that it is creating extract/insert_slice ops because we are no longer necessarily unrolling only the outer most dims. I think replacing the existing pattern makes sense as long as there is a way to recover the extract/insert ops currently produced.
Comment Actions
Yes, exactly. I'd think we should be able to run some canon patterns to fold *_strided_slice into extract/insert.
Comment Actions
Perfect, would it be preferred to replace that pattern now or is it fine to let it be a follow up patch?
Comment Actions
Thanks!
mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp | ||
---|---|---|
675 | nit: move ub to variable |
nit: VectorType source...