Skip to content

[hls-fuzzer][NFC] Optimize transfer function calling convention#968

Merged
zero9178 merged 2 commits into
mainfrom
users/zero9179/reduce-copies
Jun 11, 2026
Merged

[hls-fuzzer][NFC] Optimize transfer function calling convention#968
zero9178 merged 2 commits into
mainfrom
users/zero9179/reduce-copies

Conversation

@zero9178

Copy link
Copy Markdown
Collaborator

Prior to this PR the conjunction type system had one performance difference compared to one implementing a single large type system: When dispatching to the transfer functions of the sub-type systems, the code had to copy the sub-context for that type system into a new std::tuple of OpaqueContexts of all instances of that sub-context.

The new PR addresses this issue by making the universal calling convention just take a tuple of const void*, meaning we do not need to construct a tuple of OpaqueContexts that directly contain the sub-context within them. To enable this feature, OpaqueContext had to be refactored slightly to not use std::any anymore and allow access to its internal storage. Another benefit is that OpaqueContext could now be made a move-only type that is never copied anywhere.

Prior to this PR the conjunction type system had one performance difference compared to one implementing a single large type system: When dispatching to the transfer functions of the sub-type systems, the code had to copy the sub-context for that type system into a new `std::tuple` of `OpaqueContext`s of all instances of that sub-context.

The new PR addresses this issue by making the universal calling convention just take a tuple of `const void*`, meaning we do not need to construct a tuple of `OpaqueContext`s that directly contain the sub-context within them.
To enable this feature, `OpaqueContext` had to be refactored slightly to not use `std::any` anymore and allow access to its internal storage. Another benefit is that `OpaqueContext` could now be made a move-only type that is never copied anywhere.
@zero9178 zero9178 requested a review from Jiahui17 June 10, 2026 12:10
@zero9178 zero9178 merged commit c010e9b into main Jun 11, 2026
8 checks passed
@zero9178 zero9178 deleted the users/zero9179/reduce-copies branch June 11, 2026 08:01
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.

2 participants