Skip to content

llvm.experimental.constrained intrinsics generate invalid SPIR-V #3569

@bashbaug

Description

@bashbaug

Currently, at least some of the llvm.experimental.constrained intrinsics are generating invalid SPIR-V. Specifically, they are adding the FPRoundingMode decoration to instructions that do not support this decoration, for the OpenCL SPIR-V environment at least, see:

https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Env.html#_rounding_modes_for_conversions

These validation failures are not currently flagged by spirv-val, but they may be shortly, see:

KhronosGroup/SPIRV-Tools#6537

What should we do in this case? Some options:

  1. Fail translation - there is nothing in SPIR-V we can translate to.
  2. Drop the unsupported rounding mode decorations, potentially with a warning diagnostic.
  3. Do nothing and keep generating invalid SPIR-V, in which case a few tests will need to be updated to stop running spirv-val.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions