Skip to content

LLVM 14 code gen failure #5244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nhrrsn opened this issue May 30, 2025 · 0 comments
Open

LLVM 14 code gen failure #5244

nhrrsn opened this issue May 30, 2025 · 0 comments
Labels

Comments

@nhrrsn
Copy link

nhrrsn commented May 30, 2025

Context

  • Operating System & Odin Version:
    Odin: dev-2025-05:843648c81
    OS: Pop!_OS 22.04 LTS, Linux 6.6.6-76060606-generic
    CPU: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    RAM: 64033 MiB
    Backend: LLVM 14.0.0

Expected Behavior

No errors

Current Behavior

When compiling from the current master branch I get an LLVM code gen failure when calling certain Odin functions.
This error doesn't occur when using release branch dev-2025-04

LLVM CODE GEN FAILED FOR PROCEDURE: raylib::Vector3Angle
define float @"raylib::Vector3Angle"({ <2 x float>, float } %0, { <2 x float>, float } %1) {
decls:

Full error below.

I have seen this error in other places as well. For example when calling net::pack_dns_header

This is specifically an issue with llvm version 14 as I updated to llvm 20.1.7 and the error stopped happening.

Failure Information (for bugs)

Steps to Reproduce

I built Odin from master using make release-native
I made a demo branch containing the Odin binary and a test that fails with the below error when I run ./odin test ./tests/vendor/raylib/

Failure Logs

LLVM CODE GEN FAILED FOR PROCEDURE: raylib::Vector3Angle
define float @"raylib::Vector3Angle"({ <2 x float>, float } %0, { <2 x float>, float } %1) {
decls:
  %2 = alloca { <2 x float>, float }, align 8
  %3 = alloca [3 x float], align 16
  %4 = alloca { <2 x float>, float }, align 8
  %5 = alloca [3 x float], align 16
  %6 = alloca { <2 x float>, float }, align 16
  %7 = alloca { <2 x float>, float }, align 16
  br label %entry

entry:                                            ; preds = %decls
  store { <2 x float>, float } %0, { <2 x float>, float }* %2, align 8
  call void @llvm.memcpy.inline.p0i8.p0i8.i64([3 x float]* %3, { <2 x float>, float }* %2, i64 12, i1 false)
  %8 = load [3 x float], [3 x float]* %3, align 4
  store { <2 x float>, float } %1, { <2 x float>, float }* %4, align 8
  call void @llvm.memcpy.inline.p0i8.p0i8.i64([3 x float]* %5, { <2 x float>, float }* %4, i64 12, i1 false)
  %9 = load [3 x float], [3 x float]* %5, align 4
  %10 = bitcast { <2 x float>, float }* %6 to [3 x float]*
  store [3 x float] %8, [3 x float]* %10, align 4
  %11 = load { <2 x float>, float }, { <2 x float>, float }* %6, align 8
  %12 = bitcast { <2 x float>, float }* %7 to [3 x float]*
  store [3 x float] %9, [3 x float]* %12, align 4
  %13 = load { <2 x float>, float }, { <2 x float>, float }* %7, align 8
  %14 = call float @"linalg::vector_angle_between:proc\22contextless\22(a:[3]f32,b:[3]f32)->(:f32)"({ <2 x float>, float } %11, { <2 x float>, float } %13)
  ret float %14
}




Call parameter type does not match function signature!
  %3 = alloca [3 x float], align 16
 i8*  call void @llvm.memcpy.inline.p0i8.p0i8.i64([3 x float]* %3, { <2 x float>, float }* %2, i64 12, i1 false)
Call parameter type does not match function signature!
  %5 = alloca [3 x float], align 16
 i8*  call void @llvm.memcpy.inline.p0i8.p0i8.i64([3 x float]* %5, { <2 x float>, float }* %4, i64 12, i1 false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants