Skip to content

llvm.sadd.with.overflow: vector types not lowered #3676

@vmaksimo

Description

@vmaksimo

Currently SPIRVLowerLLVMIntrinsic.cpp maps llvm.sadd.with.overflow for scalar types i8/i16/i32/i64 only (the i8 entry was added by #3673).

Vector variants are entirely absent from the map, so any LLVM IR using e.g. llvm.sadd.with.overflow.v2i32 fails to translate.
SPIR-V supports integer vectors of 2, 3, 4, 8, and 16 components, leaving 20 vector variants uncovered: v{2,3,4,8,16}i{8,16,32,64}.

The proper fix, as noted in the review of #3673, is to replace the hand-authored IR strings in LLVMSaddWithOverflow.h with a programmatic IR expansion pass that generates the lowering for every valid type at translation time.

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