Add lowering for constant operation with ranked tensor type to
spv.constant with spv.array type.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Unit tests: pass. 62009 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 62009 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp | ||
---|---|---|
194 | Why not use RankedTensorType. | |
mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir | ||
225 | Having the constant be a tensor<2x3xi32> while the result is a !spv.array<6 x i32> is weird. To a great extent this is an artifact of the way constants are stored in MLIR, but we should probably linearize the constant to be a tensor<6xi32> to make it less weird. | |
227 | Same as above. We probably need to linearize the constant attribute to a tensor<6xi32> |
mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir | ||
---|---|---|
225 | @mravishankar thanks for review, I took those tests from structure-ops.mlir and linearize the type in same way as it works for memref, memref<2x3xf32> -> !spv.ptr<!spv.struct<!spv,array<6xf32>>>. I'll update according your suggestion. Thanks! |
Unit tests: pass. 62028 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 62028 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 62028 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir | ||
---|---|---|
225 | This does not seem to address Mahesh's comment about linearizing the tensor literal itself? (It should be easy given that the data blob remains the same; we just need to call DenseElementsAttr::reshape() on it.) We'll need a test case for n-D tensors. :) |
Unit tests: pass. 62028 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
clang-format: please reformat the code