Skip to content

Implement dispatch-less specialised functions #6

@PyPylia

Description

@PyPylia

Currently, every specialised function must have a dispatch method. However, that adds a performance overhead, and creates an inline boundary (due to changing target context).

Ultimately, some functions will have to have a dispatch method, but a way to create specialised functions without a dispatch method would be useful. Specifically, this is useful for calling specialised functions within specialised functions. This would break the inline boundary and allow for a single dispatch rather than multiple.

However, implementing this would be a challenge, as not only would codegen have to be changed significantly (such that each specialisation does not merely inline the generic, but actually generates different code so that it can call other specific specialised functions), but also it would require some way to inform separate macro invocations of what specialisations exist for a called function and what their addresses are (which I have no clue how that'd work). It would be possible to generate multiple outer functions for each specialisation, however this would break when used in an impl block, and would require simply assuming a given specialisation exists (otherwise a compile error would be generated).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions