[all-commits] [llvm/llvm-project] b2bba5: [mlir][spirv] Support conversion of `CopySignOp` t...

Guray Ozen via All-commits all-commits at lists.llvm.org
Thu Dec 8 00:11:41 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2bba5b65c9f90f9c75da35fcedec08a01640d80
  Author: Guray Ozen <guray.ozen at gmail.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
    M mlir/test/Conversion/MathToSPIRV/math-to-core-spirv.mlir

  Log Message:
  [mlir][spirv] Support conversion of `CopySignOp` to spirv for 1D vector with 1 element

Conversion of CopySignOp to SPIRV is supported for scalar and vectors but not 1D vectors with 1 element (aka vector<1xf32>). This revisions adds supports this by treating them as scalars.

An alternative solution would be to allow 0D vectors for SPIRV, but the spec [0] strictly defines the vector type as non-0D.
"Vector: An ordered homogeneous collection of two or more scalars. Vector sizes are quite restrictive and dependent on the execution model."

[0] https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_types

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D139518

More information about the All-commits mailing list