Skip to content

Tuple == with a SIMD vector element emits invalid LLVM (icmp on <8 x float>) #1995

Closed

Description

@ehartford

Found while fixing #1964; reproduces on the fix-1438 base stage1.

type V8 = Vector[8, f32]
fn main:
    let w: (i8, V8) = (1, V8.splat(1))
    let ww = w
    print(f"{ww == w}")

Sema accepts it; codegen's field-wise struct compare (Codegen.compare_value_eq) recurses into the vector element and emits icmp eq <8 x float> and and i1, <8 x i1>: "Invalid operand types for ICmp instruction". Expected: either the spec's rule for == on a tuple holding a vector (all-lanes equal?) or a Sema diagnostic if vectors are not Eq — the spec (§4.3d) should decide which; today it is a codegen crash.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions