Skip to content

simd_shuffle* doesn't check that indexes contains constant values which are within expected bounds #1960

Description

@adpaco

The LLVM backend checks that all indexes supplied via the 3rd argument to simd_shuffle are:

  1. Constant values.
  2. Within bounds for the simd_shuffle operation (i.e., 2x the length of one of the first arguments).

At present, we do not perform this type check because we don't have access to the Builder type they use for constant evaluation. But we can probably do it some other way, or just use cprover types for it.

Activity

  1. added
    [E] Unsupported UB
    on Dec 5, 2022
  2. self-assigned this
    on Dec 5, 2022
  3. added
    [C] Feature / Enhancement
    and removed
    [E] Unsupported UB
    on Dec 7, 2022
  4. adpaco commented on Dec 7, 2022

    @adpaco
    ContributorAuthor

    Actually, this would be more of an enhancement than unsupported UB. As discussed in #1961, verification shows an out-of-bounds failure because we don't check these indexes at compile time. It would be better to bring this check into the compilation stage, which is what this task would be about.

  5. added
    Z-Kani Compiler
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z-Kani Compiler[C] Feature / Enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions