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

Fix a few JITLink nits #46216

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Fix a few JITLink nits #46216

merged 1 commit into from
Aug 3, 2022

Conversation

pchintalapudi
Copy link
Member

This PR steals the JITLink improvements from #45859, and also introduces a mutex to the debuginfo JITLink plugin to make it concurrency-safe. It also updates the locking documentation.

@pchintalapudi pchintalapudi added compiler:codegen Generation of LLVM IR and native code compiler:llvm For issues that relate to LLVM labels Jul 30, 2022
@pchintalapudi pchintalapudi requested a review from vtjnash July 30, 2022 05:57
@@ -8603,7 +8603,7 @@ extern "C" void jl_init_llvm(void)
defined(JL_USE_OPROFILE_JITEVENTS) || \
defined(JL_USE_PERF_JITEVENTS)
#ifdef JL_USE_JITLINK
#error "JIT profiling support (JL_USE_*_JITEVENTS) not yet available on platforms that use JITLink"
#pragma message("JIT profiling support (JL_USE_*_JITEVENTS) not yet available on platforms that use JITLink")
Copy link
Member

Choose a reason for hiding this comment

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

I don't have a strong opinion here, but my thinking behind making it an error was that the USE_*_JITEVENTS flags need to be explicitly specified by the user, so if they can't be honoured, they shouldn't be silently ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

For whatever reason, at least on Linux-x86-64 the default make command sets one or more of these flags, so I turned it into a message so that I could test JITLink on that platform. Since at least for the time being we're not enabling JITLink on any platform except the ones that actually need it (aarch64), I thought it would be better as a message rather than an error.

Copy link
Member

Choose a reason for hiding this comment

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

Yes on Linux we ship perf support by default.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right – but couldn't we then rather just change those defaults for aarch64-linux once that is switched over as well, as that would be self-documenting for users in combination with doc/src/manual/profile.md? Maybe a compiler message is visible enough, though, I haven't tried.

for (const jitlink::Section &Sec : G.sections()) {
#ifdef _OS_DARWIN_
Copy link
Member

Choose a reason for hiding this comment

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

👍

@dnadlinger
Copy link
Member

I'll have to leave the locking (+docs) changes for somebody else to review, as I don't have a good overview of what the evolution of the codegen locking strategy is intended to look like (as long as we don't start generating code from multiple threads, the extra fine-grained locking is just clutter, hence I left it out originally).

@vtjnash
Copy link
Member

vtjnash commented Aug 1, 2022

LGTM

@vchuravy vchuravy merged commit 8dc2f49 into master Aug 3, 2022
@vchuravy vchuravy deleted the pc/jitlink-nits branch August 3, 2022 21:29
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code compiler:llvm For issues that relate to LLVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants