Skip to content

Adding optional import support to the VM. - #8916

Merged
benvanik merged 3 commits into
mainfrom
benvanik-weak-imports
Apr 19, 2022
Merged

benvanik merged 3 commits into
mainfrom
benvanik-weak-imports

Conversation

@benvanik

Copy link
Copy Markdown
Collaborator

This allows us to add functions that may not exist at runtime based on older versions, compile-time optional features, or different tooling.

This finally lets us run programs using the check module outside of iree-check-module, so tests can be easily passed to iree-run-module/iree-benchmark-module/etc.

Fixes #5731.

@benvanik benvanik added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) runtime/vm IREE bytecode VM interpreter labels Apr 18, 2022
@benvanik
benvanik force-pushed the benvanik-weak-imports branch 2 times, most recently from ceb7703 to f852aef Compare April 18, 2022 19:34
@benvanik
benvanik marked this pull request as ready for review April 18, 2022 20:02
@benvanik
benvanik requested a review from GMNGeoffrey as a code owner April 18, 2022 20:02
@benvanik
benvanik force-pushed the benvanik-weak-imports branch from f852aef to 8d3bd21 Compare April 18, 2022 21:06
@benvanik
benvanik enabled auto-merge April 19, 2022 01:03

@stellaraccident stellaraccident left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This makes sense to me and the code looks good. I originally struggled with calling them "weak" (seemed more "optional" vs "required"), but I got over it (i.e. having a "weak" import doesn't stop us from later having a "weak" export with more traditional symbol hiding semantics).

@benvanik

Copy link
Copy Markdown
Collaborator Author

I can rename it to optional/required - I like that better anyway!

@benvanik
benvanik disabled auto-merge April 19, 2022 05:02
@benvanik benvanik changed the title Adding weak import support to the VM. Adding optional import support to the VM. Apr 19, 2022
@benvanik
benvanik force-pushed the benvanik-weak-imports branch from 8d3bd21 to 00fa9c8 Compare April 19, 2022 17:13
This allows us to add functions that may not exist at runtime based
on older versions, compile-time optional features, or different tooling.
@benvanik
benvanik force-pushed the benvanik-weak-imports branch from 00fa9c8 to b006515 Compare April 19, 2022 17:19
@benvanik

Copy link
Copy Markdown
Collaborator Author

Renamed to optional | required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) runtime/vm IREE bytecode VM interpreter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants