Skip to content

ARM SIMD backend bug in llvm >= 18 #144687

Closed as not planned
Closed as not planned
@K-os

Description

@K-os

When building VVenC for ARMv7 with Clang-18 or 19 a backend bug was discovered (fraunhoferhhi/vvenc#560). The issue appeared when building with the Android NDK, but I was able to reproduce it using Clang-19 from the apt.llvm.org repository. Building the same code with Clang-17 worked without issues. Our code uses SIMD-Everywhere to translate x86 intrinsics to ARM-NEON.

This is the error message when compiling the attached reduced test-case:
FGA_sse41-8b87a7.reduced.tar.gz

fatal error: error in backend: Cannot select: 0x5f7772a16230: v4f32 = froundeven 0x5f7772a162a0
  0x5f7772a162a0: v4f32 = bitcast 0x5f7772a160e0
    0x5f7772a160e0: v2f64,ch = load<(dereferenceable load (s128) from @simde_mm_cvtps_epi32_a_, align 8, !tbaa !3)> 0x5f777298b608, 0x5f7772a16380, undef:i32
      0x5f7772a16380: i32,ch = load<(load (s32) from got)> 0x5f777298b608, 0x5f7772a16310, undef:i32
        0x5f7772a16310: i32 = ARMISD::WrapperPIC TargetGlobalAddress:i32<ptr @simde_mm_cvtps_epi32_a_> 0 [TF=8]
          0x5f7772a161c0: i32 = TargetGlobalAddress<ptr @simde_mm_cvtps_epi32_a_> 0 [TF=8]
        0x5f7772a16150: i32 = undef
      0x5f7772a16150: i32 = undef
In function: _Z20simde_mm_cvtps_epi32v

The archive also contains the LLVM bytecode in the file reduced.bc, which shows the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:ARMcrashPrefer [crash-on-valid] or [crash-on-invalid]obsoleteIssues with old (unsupported) versions of LLVM

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions