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

Initialize LLVM time trace profiler on each code generation thread #90617

Merged
merged 1 commit into from
Nov 6, 2021

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Nov 5, 2021

In https://reviews.llvm.org/D71059 LLVM 11, the time trace profiler was
extended to support multiple threads.

timeTraceProfilerInitialize creates a thread local profiler instance.
When a thread finishes timeTraceProfilerFinishThread moves a thread
local instance into a global collection of instances. Finally when all
codegen work is complete timeTraceProfilerWrite writes data from the
current thread local instance and the instances in global collection
of instances.

Previously, the profiler was intialized on a single thread only. Since
this thread performs no code generation on its own, the resulting
profile was empty.

Update LLVM codegen to initialize & finish time trace profiler on each
code generation thread.

cc @tmandry
r? @wesleywiser

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 5, 2021
In https://reviews.llvm.org/D71059 LLVM 11, the time trace profiler was
extended to support multiple threads.

`timeTraceProfilerInitialize` creates a thread local profiler instance.
When a thread finishes `timeTraceProfilerFinishThread` moves a thread
local instance into a global collection of instances. Finally when all
codegen work is complete `timeTraceProfilerWrite` writes data from the
current thread local instance and the instances in global collection
of instances.

Previously, the profiler was intialized on a single thread only. Since
this thread performs no code generation on its own, the resulting
profile was empty.

Update LLVM codegen to initialize & finish time trace profiler on each
code generation thread.
@tmiasko tmiasko force-pushed the time-trace-threads branch from a74ad58 to 5a09e12 Compare November 5, 2021 16:50
@wesleywiser
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 5, 2021

📌 Commit 5a09e12 has been approved by wesleywiser

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2021
@bors
Copy link
Contributor

bors commented Nov 6, 2021

⌛ Testing commit 5a09e12 with merge 3cd3bbe...

@bors
Copy link
Contributor

bors commented Nov 6, 2021

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing 3cd3bbe to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 6, 2021
@bors bors merged commit 3cd3bbe into rust-lang:master Nov 6, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 6, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3cd3bbe): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@tmiasko tmiasko deleted the time-trace-threads branch November 6, 2021 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants