Skip to content

Support weak imports in VM modules and a vm op for checking whether a function exists. #5731

Closed

Description

@benvanik

To allow for patching, specialization, and backwards compatibility we should support IREE_VM_FUNCTION_LINKAGE_IMPORT_WEAK. This would allow an import to be missing during linking without failing the load. We can also add a new vm op to query whether a call is possible (vm.call.exists or something) to enable us to create branching code paths based on presence.

These two things together would give us the ability to do feature-detection-based polyfills of modules such as when new HAL features are added that may not exist on older runtimes. It also allows for all kinds of fun with overlaying optimized variants of functions into existing modules (the compiler always emits @_some_internal_thing and then runtimes that have an optimized version of that could provide their own version).

We'd still have to ensure signatures matched - this is strictly for symbol resolution during linking.

Activity

  1. added
    runtime/vm
    on May 4, 2021
  2. self-assigned this
    on May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

runtime/vm

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions