[PATCH] D73022: [mlir][spirv] Add lowering for composite constant.

Denis Khalikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 12:45:46 PST 2020


denis13 marked an inline comment as done.
denis13 added inline comments.


================
Comment at: mlir/test/Conversion/StandardToSPIRV/std-to-spirv.mlir:225
+  %5 = constant dense<1> : tensor<2x3xi32>
+  // CHECK: spv.constant dense<1.000000e+00> : tensor<2x3xf32> : !spv.array<6 x f32 [4]>
+  %6 = constant dense<1.0> : tensor<2x3xf32>
----------------
mravishankar wrote:
> 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.
@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!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73022/new/

https://reviews.llvm.org/D73022





More information about the llvm-commits mailing list