Skip to content
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

Storing intrinsics to local variables overwrites their names. #26

Open
m-kurtenacker opened this issue Jul 22, 2024 · 1 comment
Open

Comments

@m-kurtenacker
Copy link
Contributor

Simple way to reproduce this issue:

#[import(cc = "device", name = "llvm.exp.f32")] fn cpu_expf(_: f32) -> f32;

#[export]
fn foo (n : f32) -> f32 {
    let bar = cpu_expf;

    cpu_expf(n)
}

Defining bar overwrites the name of cpu_expf, which results in broken code being produced in thorin.

We should probably not rely on the names of continuations as much as we currently do.

@madmann91
Copy link
Contributor

The name is only here for debugging purposes, so I think it is fine to add a check that it is not already set before setting it.

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

No branches or pull requests

2 participants