Added support for broadcasting size-1 dimensions for TOSA elementwise
operations.
Details
- Reviewers
rriddle silvas - Commits
- rGc19a4128095d: [MLIR][TOSA] Tosa elementwise broadcasting
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There is a typo in the commit description: elemtnwise
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
155 | The way the error message is worded makes me think that this should be an assert. | |
166 | Cache end iterators to avoid recomputing during the loop. https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop | |
211 | nit: Spell out auto here. Type is the same number of characters as auto. | |
218 | nit: Drop trivial braces here. | |
229 | Same comment here on braces, and caching the number of results. Although in this case, seems better to do something like: indexingMaps.append(operation->getNumResults(), rewriter.getMultiDimIdentityMap(nloops)); |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
---|---|---|
17 | add tests |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
---|---|---|
17 | I revamped the previous failing broadcasting test. Updated to include additional broadcasting tests. |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
161 | add assertion message. | |
169 | Tosa op verifiers should enforce this already. Can be deleted. | |
204 | Now it supports broadcast :) | |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
59–60 | Capture with filecheck. Example of "non-local" capture requires "$": https://github.com/llvm/llvm-project/blob/main/mlir/test/Conversion/SCFToGPU/parallel_loop.mlir#L18 |
The way the error message is worded makes me think that this should be an assert.