Skip to content

[flang][runtime] Further work on speeding up work queue operations #149189

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

klausler
Copy link
Contributor

This patch avoids a trip through the work queue engine for cases on a CPU where finalization and destruction actions during assignment were handled without enqueueing another task.

This patch avoids a trip through the work queue engine for cases
on a CPU where finalization and destruction actions during assignment
were handled without enqueueing another task.
Copy link
Contributor

@akuhlens akuhlens left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -279,13 +279,15 @@ RT_API_ATTRS int AssignTicket::Begin(WorkQueue &workQueue) {
if (mustDeallocateLHS) {
// Convert the LHS into a temporary, then make it look deallocated.
toDeallocate_ = &tempDescriptor_.descriptor();
persist_ = true; // tempDescriptor_ state must outlive child tickets
Copy link
Contributor

Choose a reason for hiding this comment

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

The general idea here is that by delaying conditionally setting persist, we can avoid persisting the allocation under some conditions and avoid the overhead of a trip through the work queue in those cases, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it was being set unconditionally, so it would be true even when the child task was run immediately as BeginDestroy or whatever, and that caused a later no-op suspension and resumption.

@klausler klausler merged commit 97a8476 into llvm:main Jul 18, 2025
10 checks passed
@klausler klausler deleted the faster-wq branch July 18, 2025 20:44
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