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

cglobal: Fall back to runtime intrinsic #54914

Merged
merged 1 commit into from
Jun 28, 2024
Merged

cglobal: Fall back to runtime intrinsic #54914

merged 1 commit into from
Jun 28, 2024

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 24, 2024

Our codegen for cglobal was sharing the static_eval code for symbols with ccall. However, we do have full runtime emulation for this intrinsic, so mandating that the symbol can be statically evaluated is not required and causes semantic differences between the interpreter and codegen, which is undesirable. Just fall back to the runtime intrinsic instead.

Our codegen for `cglobal` was sharing the `static_eval` code for symbols
with ccall. However, we do have full runtime emulation for this intrinsic,
so mandating that the symbol can be statically evaluated is not required
and causes semantic differences between the interpreter and codegen, which
is undesirable. Just fall back to the runtime intrinsic instead.
@Keno Keno requested a review from vtjnash June 24, 2024 09:45
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this #10142?

@Keno
Copy link
Member Author

Keno commented Jun 24, 2024

It's still implemented in the runtime intrinsic path, but yes, it removes codegen support for it.

@Pangoraw
Copy link
Contributor

With this change, the error message for cglobal can be removed in:

julia/src/ccall.cpp

Lines 579 to 584 in f3298ee

static inline const char *invalid_symbol_err_msg(bool ccall)
{
return ccall ?
"ccall: first argument not a pointer or valid constant expression" :
"cglobal: first argument not a pointer or valid constant expression";
}

since invalid_symbol_err_msg is now always called with ccall=true.

@Keno Keno merged commit 8791d54 into master Jun 28, 2024
7 checks passed
@Keno Keno deleted the kf/cglobalfallback branch June 28, 2024 11:07
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

Successfully merging this pull request may close these issues.

3 participants