Skip to content

Conversation

@ZuseZ4
Copy link
Member

@ZuseZ4 ZuseZ4 commented Jan 9, 2026

Right now we initialize the openmp/offload runtime before every single offload call, and tear it down directly afterwards.
What we should rather do is initialize it once in the binary startup code, and tear it down at the end of the binary execution. Here I implement these changes.

Together, our generated IR has a lot less usage of globals, which in turn simplifies the refactoring in #150683, where I introduce a new variant of our offload intrinsic.

r? oli-obk

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 9, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2026

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the move-un-register-lib branch 2 times, most recently from 788ce48 to 542e8e2 Compare January 9, 2026 21:24
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the move-un-register-lib branch 3 times, most recently from c5134ae to 79a9d30 Compare January 10, 2026 00:06
@ZuseZ4 ZuseZ4 mentioned this pull request Jan 10, 2026
5 tasks
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Jan 11, 2026

@kevinsala #150683 fails with the commit where I drop init_all_rtls(), it also mentions that 0 devices are available.

omptarget fatal error -1: "invalid value" device number '-1' out of range, only 0 devices available

@ZuseZ4 ZuseZ4 force-pushed the move-un-register-lib branch from c0920cd to 6073368 Compare January 13, 2026 23:19
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Jan 13, 2026

I dropped the last commit, since we'll still need init_all_rtls till I replace the clang-linker-wrapper. I left a note instead.
@rustbot ready

@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Jan 19, 2026

Since oli is currently busy,
@rustbot reroll

@rustbot rustbot assigned chenyukang and unassigned oli-obk Jan 19, 2026
@chenyukang
Copy link
Member

@rustbot reroll

@rustbot rustbot assigned davidtwco and unassigned chenyukang Jan 20, 2026
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 20, 2026
@rust-log-analyzer

This comment has been minimized.

@ZuseZ4 ZuseZ4 force-pushed the move-un-register-lib branch from a079a23 to 31860e3 Compare January 21, 2026 01:06
@rustbot
Copy link
Collaborator

rustbot commented Jan 21, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Jan 21, 2026
@ZuseZ4 ZuseZ4 force-pushed the move-un-register-lib branch from 31860e3 to 7069772 Compare January 21, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants